不会,顶一个
楼主看看MSDN呢?

解决方案 »

  1.   

    这个是我写的读出当前所有Session的方法,要读出IIS中所有的,你自己摸索一下
    /// <summary>
    /// 获取Session集合中的某Session.
    /// </summary>
    /// <param name="strSessionName">Session名称</param>
    /// <returns>Object变量</returns>
    public object GetHttpContextSession(string strSessionName)
    {
    object oData = null; HttpSessionState httpSessionState = HttpContext.Current.Session; IEnumerator iEnum = httpSessionState.Keys.GetEnumerator(); try
    {
    while (iEnum.MoveNext())
    {
    object local = iEnum.Current;
    if (local != null)
    {
    string SessionName = local.ToString();
    if(SessionName.ToUpper() == strSessionName.ToUpper())
    {
    oData = httpSessionState[SessionName];
    break;
    }
    }
    }
    }
    finally
    {
    IDisposable iDisposable = iEnum as IDisposable;
    if (iDisposable != null)
    {
    iDisposable.Dispose();
    }
    }
    return oData;
    }
      

  2.   

    要读取所有Session 这里需要更改HttpSessionState httpSessionState = HttpContext.Current.Session;