webserver中使用session
Random rnd = new Random();
int n = rnd.Next(100000, 999999);
try
{
// Session["code"] = n.ToString();
//Session.Add("code", n.ToString());
Session["code"] = "123123";
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
return isbool;
}
session老报“未将对象引用设置到对象实例”?
[解决办法]
[WebMethod(EnableSession = true)]
[解决办法]
有调试没?是走到哪里报的这个错?