<HTML> <HEAD> <TITLE>首页</TITLE> <script language="VB" runat="server"> Sub Page_Load(Sender As Object, e As EventArgs) Message.Text = String.Format("你好,{0}", Context.User.Identity.Name) End Sub sub btnSignout_Click(Sender as Object, E as EventArgs) FormsAuthentication.SignOut() Response.Redirect("login.aspx") end sub </script> </HEAD> <BODY> <asp:label id="Message" runat="server"/> <br> <form method="post" runat="server"> <asp:button id="btnSignout" Text="退出登录" runat="server" OnClick="btnSignout_Click"/> </form> </BODY> </HTML>