除了引用using System.Web.SessionState; 还需要加上System.Web.SessionState.IRequiresSessionState
引用格式如下,需要注意的地方用红色标注了。
public class QQCallbackHandle : IHttpHandler,System.Web.SessionState.IRequiresSessionState {
public void ProcessRequest (HttpContext context) {
var QQcontext =new QConnectSDK.Context.QzoneContext();
string state = Guid.NewGuid().ToString().Replace("-","");
string scope ="";
var authenticationUrl = QQcontext.GetAuthorizationUrl(state, scope);
//request token, request token secret 需要保存起来
//在demo演示中,直接保存在全局变量中.真实情况需要网站自己处理