温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:晶晶Vb.net留言板源码
当前文件:
VbGuestBook/log.aspx.vb,打开代码结构图
VbGuestBook/log.aspx.vb,打开代码结构图1Imports System 2
Imports System.ComponentModel 3
Imports System.Data 4
Imports System.Web 5
Imports System.Web.SessionState 6
Imports System.Web.UI 7
Imports System.Web.UI.WebControls 8
Imports System.Configuration 9
Imports Microsoft.VisualBasic 10
'51aspx.com 11
Public Class log 12
Inherits System.Web.UI.Page 13
Protected WithEvents Label1 As System.Web.UI.WebControls.Label 14
Protected WithEvents password As System.Web.UI.WebControls.TextBox 15
Protected WithEvents Button1 As System.Web.UI.WebControls.Button 16
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox 17
18
Web 窗体设计器生成的代码 32
33
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 34
If password.Text <> ConfigurationSettings.AppSettings("密码") Then 35
Label1.Text = "密码错误,请重新输入" 36
Else 37
Session("name") = ConfigurationSettings.AppSettings("站长") 38
Response.Redirect("default.aspx") 39
End If 40
End Sub 41
42
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 43
If Session("name") <> "" Then 44
Session.Abandon() 45
Response.Redirect("default.aspx") 46
End If 47
End Sub 48
End Class 49







