⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setup.aspx.vb

📁 毕业设计时做的,一个管理关于污染管理的, 源代码,呵呵 想想当时还真厉害,可以实现污染检测
💻 VB
字号:
Imports System
Imports System.ComponentModel
Imports System.Data
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Configuration
Imports Microsoft.VisualBasic

Public Class setup
    Inherits System.Web.UI.Page
    Protected WithEvents s1 As System.Web.UI.WebControls.TextBox
    Protected WithEvents s2 As System.Web.UI.WebControls.TextBox
    Protected WithEvents s3 As System.Web.UI.WebControls.TextBox
    Protected WithEvents s4 As System.Web.UI.WebControls.TextBox
    Protected WithEvents s5 As System.Web.UI.WebControls.TextBox
    Protected WithEvents s6 As System.Web.UI.WebControls.TextBox
    Protected WithEvents s7 As System.Web.UI.WebControls.TextBox
    Protected WithEvents s8 As System.Web.UI.WebControls.TextBox
    Protected WithEvents s9 As System.Web.UI.WebControls.TextBox
    Protected WithEvents s10 As System.Web.UI.WebControls.TextBox
    Protected WithEvents s11 As System.Web.UI.WebControls.TextBox
    Protected WithEvents s15 As System.Web.UI.WebControls.TextBox
    Protected WithEvents s16 As System.Web.UI.WebControls.TextBox
    Protected WithEvents s17 As System.Web.UI.WebControls.TextBox
    Protected WithEvents Button1 As System.Web.UI.WebControls.Button
    Protected WithEvents Button2 As System.Web.UI.WebControls.Button
    Protected WithEvents color4 As System.Web.UI.HtmlControls.HtmlInputText
    Protected WithEvents color3 As System.Web.UI.HtmlControls.HtmlInputText
    Protected WithEvents color2 As System.Web.UI.HtmlControls.HtmlInputText
    Protected WithEvents color1 As System.Web.UI.HtmlControls.HtmlInputText
    Protected WithEvents s12 As System.Web.UI.WebControls.DropDownList
    Protected WithEvents color5 As System.Web.UI.HtmlControls.HtmlInputText
    Protected WithEvents s14 As System.Web.UI.WebControls.DropDownList

#Region " Web 窗体设计器生成的代码 "

    '该调用是 Web 窗体设计器所必需的。
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
        '不要使用代码编辑器修改它。
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Session("name") <> ConfigurationSettings.AppSettings("站长") Then Response.Redirect("default.aspx")
        If Not IsPostBack Then
            Dim ds As DataSet
            ds = New DataSet()
            ds.ReadXml(Server.MapPath("web.config"))
            s1.Text = ds.Tables(1).Rows(0)(1)
            s2.Text = ds.Tables(1).Rows(3)(1)
            s3.Text = ds.Tables(1).Rows(2)(1)
            s4.Text = ds.Tables(1).Rows(4)(1)
            s5.Text = ds.Tables(1).Rows(6)(1)
            s6.Text = ds.Tables(1).Rows(5)(1)
            s7.Text = ds.Tables(1).Rows(7)(1)
            s8.Text = ds.Tables(1).Rows(8)(1)
            s9.Text = ds.Tables(1).Rows(9)(1)
            s10.Text = ds.Tables(1).Rows(10)(1)
            s11.Text = ds.Tables(1).Rows(11)(1)
            color1.Style.Item("BACKGROUND-COLOR") = ds.Tables(1).Rows(7)(1)
            color2.Style.Item("BACKGROUND-COLOR") = ds.Tables(1).Rows(8)(1)
            color3.Style.Item("BACKGROUND-COLOR") = ds.Tables(1).Rows(9)(1)
            color4.Style.Item("BACKGROUND-COLOR") = ds.Tables(1).Rows(10)(1)
            color5.Style.Item("BACKGROUND-COLOR") = ds.Tables(1).Rows(11)(1)
            If UCase(ds.Tables(1).Rows(12)(1)) = "YES" Then
                s12.SelectedIndex = 0
            Else
                s12.SelectedIndex = 1
            End If
            If UCase(ds.Tables(1).Rows(13)(1)) = "YES" Then
                s14.SelectedIndex = 0
            Else
                s14.SelectedIndex = 1
            End If
            s15.Text = ds.Tables(1).Rows(14)(1)
            s16.Text = ds.Tables(1).Rows(15)(1)
            s17.Text = ds.Tables(1).Rows(16)(1)
            ds.Clear()
            ds.Dispose()
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim ds As DataSet
        ds = New DataSet()
        ds.ReadXml(Server.MapPath("web.config"))
        ds.Tables(1).Rows(7)(1) = "#000000"
        ds.Tables(1).Rows(8)(1) = "#000000"
        ds.Tables(1).Rows(9)(1) = "#336600"
        ds.Tables(1).Rows(10)(1) = "#0099CC"
        ds.Tables(1).Rows(11)(1) = "#EEECF2"
        ds.Tables(1).Rows(12)(1) = "NO"
        ds.Tables(1).Rows(13)(1) = "YES"
        ds.Tables(1).Rows(14)(1) = "30"
        ds.Tables(1).Rows(15)(1) = "1024"
        ds.Tables(1).Rows(16)(1) = "5"
        ds.AcceptChanges()
        ds.WriteXml(Server.MapPath("web.config"))
        ds.Clear()
        ds.Dispose()
        Response.Redirect("default.aspx")
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim ds As DataSet, p(5) As String
        If s12.SelectedItem.Value = "YES" Then
            p(1) = "YES"
        Else
            p(1) = "NO"
        End If
        If s14.SelectedItem.Value = "YES" Then
            p(2) = "YES"
        Else
            p(2) = "NO"
        End If
        If IsNumeric(s15.Text) = False Then
            p(3) = "30"
        Else
            p(3) = s15.Text.ToString
        End If
        If IsNumeric(s16.Text) = False Then
            p(4) = "1024"
        Else
            p(4) = s16.Text.ToString
        End If
        If IsNumeric(s17.Text) = False Then
            p(5) = "5"
        Else
            p(5) = s17.Text.ToString
        End If
        ds = New DataSet()
        ds.ReadXml(Server.MapPath("web.config"))
        ds.Tables(1).Rows(0)(1) = s1.Text
        ds.Tables(1).Rows(3)(1) = s2.Text
        ds.Tables(1).Rows(2)(1) = s3.Text
        ds.Tables(1).Rows(4)(1) = s4.Text
        ds.Tables(1).Rows(5)(1) = s6.Text
        ds.Tables(1).Rows(6)(1) = s5.Text
        ds.Tables(1).Rows(7)(1) = s7.Text
        ds.Tables(1).Rows(8)(1) = s8.Text
        ds.Tables(1).Rows(9)(1) = s9.Text
        ds.Tables(1).Rows(10)(1) = s10.Text
        ds.Tables(1).Rows(11)(1) = s11.Text
        ds.Tables(1).Rows(12)(1) = p(1)
        ds.Tables(1).Rows(13)(1) = p(2)
        ds.Tables(1).Rows(14)(1) = p(3)
        ds.Tables(1).Rows(15)(1) = p(4)
        ds.Tables(1).Rows(16)(1) = p(5)
        ds.AcceptChanges()
        ds.WriteXml(Server.MapPath("web.config"))
        ds.Clear()
        ds.Dispose()
        Response.Redirect("default.aspx")
    End Sub
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -