温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:晶晶Vb.net留言板源码
当前文件:
VbGuestBook/setup.aspx.vb,打开代码结构图
VbGuestBook/setup.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
11
Public Class setup 12
Inherits System.Web.UI.Page 13
Protected WithEvents s1 As System.Web.UI.WebControls.TextBox 14
Protected WithEvents s2 As System.Web.UI.WebControls.TextBox 15
Protected WithEvents s3 As System.Web.UI.WebControls.TextBox 16
Protected WithEvents s4 As System.Web.UI.WebControls.TextBox 17
Protected WithEvents s5 As System.Web.UI.WebControls.TextBox 18
Protected WithEvents s6 As System.Web.UI.WebControls.TextBox 19
Protected WithEvents s7 As System.Web.UI.WebControls.TextBox 20
Protected WithEvents s8 As System.Web.UI.WebControls.TextBox 21
Protected WithEvents s9 As System.Web.UI.WebControls.TextBox 22
Protected WithEvents s10 As System.Web.UI.WebControls.TextBox 23
Protected WithEvents s11 As System.Web.UI.WebControls.TextBox 24
Protected WithEvents s15 As System.Web.UI.WebControls.TextBox 25
Protected WithEvents s16 As System.Web.UI.WebControls.TextBox 26
Protected WithEvents s17 As System.Web.UI.WebControls.TextBox 27
Protected WithEvents Button1 As System.Web.UI.WebControls.Button 28
Protected WithEvents Button2 As System.Web.UI.WebControls.Button 29
Protected WithEvents color4 As System.Web.UI.HtmlControls.HtmlInputText 30
Protected WithEvents color3 As System.Web.UI.HtmlControls.HtmlInputText 31
Protected WithEvents color2 As System.Web.UI.HtmlControls.HtmlInputText 32
Protected WithEvents color1 As System.Web.UI.HtmlControls.HtmlInputText 33
Protected WithEvents s12 As System.Web.UI.WebControls.DropDownList 34
Protected WithEvents color5 As System.Web.UI.HtmlControls.HtmlInputText 35
Protected WithEvents s14 As System.Web.UI.WebControls.DropDownList 36
37
Web 窗体设计器生成的代码 51
52
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 53
If Session("name") <> ConfigurationSettings.AppSettings("站长") Then Response.Redirect("default.aspx") 54
If Not IsPostBack Then 55
Dim ds As DataSet 56
ds = New DataSet() 57
ds.ReadXml(Server.MapPath("web.config")) 58
s1.Text = ds.Tables(1).Rows(0)(1) 59
s2.Text = ds.Tables(1).Rows(3)(1) 60
s3.Text = ds.Tables(1).Rows(2)(1) 61
s4.Text = ds.Tables(1).Rows(4)(1) 62
s5.Text = ds.Tables(1).Rows(6)(1) 63
s6.Text = ds.Tables(1).Rows(5)(1) 64
s7.Text = ds.Tables(1).Rows(7)(1) 65
s8.Text = ds.Tables(1).Rows(8)(1) 66
s9.Text = ds.Tables(1).Rows(9)(1) 67
s10.Text = ds.Tables(1).Rows(10)(1) 68
s11.Text = ds.Tables(1).Rows(11)(1) 69
color1.Style.Item("BACKGROUND-COLOR") = ds.Tables(1).Rows(7)(1) 70
color2.Style.Item("BACKGROUND-COLOR") = ds.Tables(1).Rows(8)(1) 71
color3.Style.Item("BACKGROUND-COLOR") = ds.Tables(1).Rows(9)(1) 72
color4.Style.Item("BACKGROUND-COLOR") = ds.Tables(1).Rows(10)(1) 73
color5.Style.Item("BACKGROUND-COLOR") = ds.Tables(1).Rows(11)(1) 74
If UCase(ds.Tables(1).Rows(12)(1)) = "YES" Then 75
s12.SelectedIndex = 0 76
Else 77
s12.SelectedIndex = 1 78
End If 79
If UCase(ds.Tables(1).Rows(13)(1)) = "YES" Then 80
s14.SelectedIndex = 0 81
Else 82
s14.SelectedIndex = 1 83
End If 84
s15.Text = ds.Tables(1).Rows(14)(1) 85
s16.Text = ds.Tables(1).Rows(15)(1) 86
s17.Text = ds.Tables(1).Rows(16)(1) 87
ds.Clear() 88
ds.Dispose() 89
End If 90
End Sub 91
92
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 93
Dim ds As DataSet 94
ds = New DataSet() 95
ds.ReadXml(Server.MapPath("web.config")) 96
ds.Tables(1).Rows(7)(1) = "#000000" 97
ds.Tables(1).Rows(8)(1) = "#000000" 98
ds.Tables(1).Rows(9)(1) = "#336600" 99
ds.Tables(1).Rows(10)(1) = "#0099CC" 100
ds.Tables(1).Rows(11)(1) = "#EEECF2" 101
ds.Tables(1).Rows(12)(1) = "NO" 102
ds.Tables(1).Rows(13)(1) = "YES" 103
ds.Tables(1).Rows(14)(1) = "30" 104
ds.Tables(1).Rows(15)(1) = "1024" 105
ds.Tables(1).Rows(16)(1) = "5" 106
ds.AcceptChanges() 107
ds.WriteXml(Server.MapPath("web.config")) 108
ds.Clear() 109
ds.Dispose() 110
Response.Redirect("default.aspx") 111
End Sub 112
113
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 114
Dim ds As DataSet, p(5) As String 115
If s12.SelectedItem.Value = "YES" Then 116
p(1) = "YES" 117
Else 118
p(1) = "NO" 119
End If 120
If s14.SelectedItem.Value = "YES" Then 121
p(2) = "YES" 122
Else 123
p(2) = "NO" 124
End If 125
If IsNumeric(s15.Text) = False Then 126
p(3) = "30" 127
Else 128
p(3) = s15.Text.ToString 129
End If 130
If IsNumeric(s16.Text) = False Then 131
p(4) = "1024" 132
Else 133
p(4) = s16.Text.ToString 134
End If 135
If IsNumeric(s17.Text) = False Then 136
p(5) = "5" 137
Else 138
p(5) = s17.Text.ToString 139
End If 140
ds = New DataSet() 141
ds.ReadXml(Server.MapPath("web.config")) 142
ds.Tables(1).Rows(0)(1) = s1.Text 143
ds.Tables(1).Rows(3)(1) = s2.Text 144
ds.Tables(1).Rows(2)(1) = s3.Text 145
ds.Tables(1).Rows(4)(1) = s4.Text 146
ds.Tables(1).Rows(5)(1) = s6.Text 147
ds.Tables(1).Rows(6)(1) = s5.Text 148
ds.Tables(1).Rows(7)(1) = s7.Text 149
ds.Tables(1).Rows(8)(1) = s8.Text 150
ds.Tables(1).Rows(9)(1) = s9.Text 151
ds.Tables(1).Rows(10)(1) = s10.Text 152
ds.Tables(1).Rows(11)(1) = s11.Text 153
ds.Tables(1).Rows(12)(1) = p(1) 154
ds.Tables(1).Rows(13)(1) = p(2) 155
ds.Tables(1).Rows(14)(1) = p(3) 156
ds.Tables(1).Rows(15)(1) = p(4) 157
ds.Tables(1).Rows(16)(1) = p(5) 158
ds.AcceptChanges() 159
ds.WriteXml(Server.MapPath("web.config")) 160
ds.Clear() 161
ds.Dispose() 162
Response.Redirect("default.aspx") 163
End Sub 164
End Class 165







