这个可以用你的代码(写个函数)解决啊,不用什么专业的书!呵呵呵!
下面是简单的例子!web的!
 Public Function InspectPage(ByRef UPage As Page) As Boolean  ', ByVal UID As Integer, ByVal UState As Integer)
        Dim UID As Integer = CInt(UPage.Session("UID"))
        Dim UState As Integer = CInt(UPage.Session("UState"))
        If UID = 0 Or UState = 0 Then
            UPage.RegisterStartupScript("page", "<script>top.location.href='../StartPage.htm';</script>")
            Return False
        Else
            Return True
        End If
    End Function

解决方案 »

  1.   

    http协议是一种无状态的连接。。在Session利用Cookie实现的Cookie存在于客户端,也就是用户的机器中,里面保存着用户的Session ID,也就是Session号码,当用户的浏览器请求服务器时把Session ID也一起送到  
    服务器,这样服务器就可以识别你是谁。
      

  2.   

    还有一个问题:我可以在客户端读到这个SESSION得ID号吗?怎么读?
      

  3.   

    这个应该是自动登陆的实现问题
    建议参考wrox出版社的<<asp.net高级编程>>的相关章节。
      

  4.   

    //在Web.Config的System.Web中加:
    <authentication mode="Forms">
    <forms name=".ASPXUSERDEMO" loginUrl="login.aspx" protection="All" timeout="60" />
    </authentication>
    <authorization>
    <deny users="?" />
    </authorization>
    **********************************************************
    在代碼中加
    System.Web.Security.FormsAuthentication.RedirectFromLoginPage(strUserInfo[0],false);
    搞掂!
    以上是asp.net常用的用法
      

  5.   

    對不起﹐我寫的代碼沒寫﹐現改正
    System.Web.Security.FormsAuthentication.RedirectFromLoginPage(strUserInfo[0],false);
    System.Web.Security.FormsAuthentication.RedirectFromLoginPage(用戶名,false);
      

  6.   

    关于session的例子以前有过相关的贴子!
    http://expert.csdn.net/Expert/topic/1316/1316977.xml?temp=9.313601E-02