在webService里面Session默认是不可用的,必须得开启Session才能使用,如需要在当前方法上启用Session [WebMethod(EnableSession = true)][WebMethod(EnableSession = true)] public string Login(string name) { Context.Session["name"] = name; return name; }
在webService里面Session默认是不可用的,必须得开启Session才能使用,如需要在当前方法上启用Session [WebMethod(EnableSession = true)][WebMethod(EnableSession = true)] public string Login(string name) { Context.Session["name"] = name; return name; }