handler(一般处理程序)使用session

1.导入

using System.Web.SessionState;

2.添加

 public class TreeData : IHttpHandler, IRequiresSessionState, IReadOnlySessionState
{}

3.使用

System.Web.HttpContext.Current.Session["num"].ToString();
原文地址:https://www.cnblogs.com/dodui/p/sarbro.html