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

📄 users.aspx.vb

📁 VB.NET和SQLSERver2000编写在线考试系统
💻 VB
字号:
Public Class users
    Inherits System.Web.UI.Page

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

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

    End Sub
    Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid
    Protected WithEvents DataGrid2 As System.Web.UI.WebControls.DataGrid
    Protected WithEvents DataGrid3 As System.Web.UI.WebControls.DataGrid
    Protected WithEvents Label1 As System.Web.UI.WebControls.Label
    Protected WithEvents Label2 As System.Web.UI.WebControls.Label
    Protected WithEvents Label3 As System.Web.UI.WebControls.Label
    Protected WithEvents ImageButton1 As System.Web.UI.WebControls.ImageButton

    '注意: 以下占位符声明是 Web 窗体设计器所必需的。
    '不要删除或移动它。
    Private designerPlaceholderDeclaration As System.Object

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

#End Region
    Public Sub Present_weekday()
        Dim strtoday As String
        Dim weekarray(6) As String
        Dim thisyear As String
        Dim thismonth As String
        Dim thisday As String
        weekarray(0) = "星期六"
        weekarray(1) = "星期天"
        weekarray(2) = "星期一"
        weekarray(3) = "星期二"
        weekarray(4) = "星期三"
        weekarray(5) = "星期四"
        weekarray(6) = "星期五"
        thisyear = Year(Now()) & "年"
        thismonth = Month(Now())
        If (thismonth < 10) Then
            thismonth = "0" & thismonth
        End If
        thismonth = thismonth & "月"
        thisday = Day(Now())
        If (thisday < 10) Then
            thisday = "0" & thisday
        End If
        thisday = thisday & "日"
        strtoday = thisyear & thismonth & thisday
        strtoday = strtoday & "  " & weekarray(Weekday(Now()) - 1)
        Response.Write(strtoday)
    End Sub
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '在此处放置初始化页的用户代码
        Dim q As SqlClass = New SqlClass
        q.Open()
        Dim str As String = "select ID 编号,用户名,密码,权限 from 超级用户表"
        Dim Dt As DataTable = q.GetDataTable(str, "编号")
        Dim dv As DataView = New DataView(Dt)
        DataGrid1.DataSource = dv
        DataGrid1.DataBind()
        str = "select ID 编号,用户名,密码,权限 from 单位记录表"
        Dt = q.GetDataTable(str, "编号")
        dv = New DataView(Dt)
        DataGrid2.DataSource = dv
        DataGrid2.DataBind()
        str = "select ID 编号,用户名,密码,权限 from 用户记录表"
        Dt = q.GetDataTable(str, "编号")
        dv = New DataView(Dt)
        DataGrid3.DataSource = dv
        DataGrid3.DataBind()
        q.close()
        Present_weekday()
    End Sub

    Private Sub DataGrid1_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles DataGrid1.PageIndexChanged
        DataGrid1.CurrentPageIndex = e.NewPageIndex
        Dim q As SqlClass = New SqlClass
        q.Open()
        Dim str As String = "select ID 编号,用户名,密码,权限 from 超级用户表"
        Dim Dt As DataTable = q.GetDataTable(str, "编号")
        Dim dv As DataView = New DataView(Dt)
        DataGrid1.DataSource = dv
        DataGrid1.DataBind()
        q.close()
    End Sub

    Private Sub DataGrid2_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles DataGrid2.PageIndexChanged
        DataGrid2.CurrentPageIndex = e.NewPageIndex
        Dim q As SqlClass = New SqlClass
        q.Open()
        Dim str As String = "select ID 编号,用户名,密码,权限 from 单位记录表"
        Dim Dt As DataTable = q.GetDataTable(str, "编号")
        Dim dv As DataView = New DataView(Dt)
        DataGrid1.DataSource = dv
        DataGrid1.DataBind()
        q.close()
    End Sub

  
    Private Sub DataGrid3_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles DataGrid3.PageIndexChanged
        DataGrid2.CurrentPageIndex = e.NewPageIndex
        Dim q As SqlClass = New SqlClass
        q.Open()
        Dim str As String = "select ID 编号,用户名,密码,权限 from 用户记录表"
        Dim Dt As DataTable = q.GetDataTable(str, "编号")
        Dim dv As DataView = New DataView(Dt)
        DataGrid1.DataSource = dv
        DataGrid1.DataBind()
        q.close()
    End Sub

    Private Sub ImageButton1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
        Response.Redirect("idmanage.aspx")
    End Sub
End Class

⌨️ 快捷键说明

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