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

📄 student.aspx.vb

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

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

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

    End Sub
    Protected WithEvents Image11 As System.Web.UI.WebControls.Image
    Protected WithEvents Image10 As System.Web.UI.WebControls.Image
    Protected WithEvents Image9 As System.Web.UI.WebControls.Image
    Protected WithEvents Image7 As System.Web.UI.WebControls.Image
    Protected WithEvents Image6 As System.Web.UI.WebControls.Image
    Protected WithEvents Image5 As System.Web.UI.WebControls.Image
    Protected WithEvents Image4 As System.Web.UI.WebControls.Image
    Protected WithEvents Image3 As System.Web.UI.WebControls.Image
    Protected WithEvents Image8 As System.Web.UI.WebControls.Image
    Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid
    Protected WithEvents LinkButton1 As System.Web.UI.WebControls.LinkButton

    '注意: 以下占位符声明是 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
        If Not IsPostBack Then
            Try
                If (Session("userpower") <> 1) Then
                    Response.End()
                End If
            Catch ex As Exception
                Response.Write("您还登录,请您先登录<a href='Login.aspx'>首页</a>")
                Response.End()
            End Try
            Dim q As SqlClass = New SqlClass
            q.Open()
            Dim str As String = "select 试卷名称,总分,时间 from 试卷名称表"
            Dim Dt As DataTable = q.GetDataTable(str, "试卷名称")
            Dim dv As DataView = New DataView(Dt)
            Dim i As Integer
            For i = 0 To dv.Count - 1
                Dt.Rows(i)("时间") = Dt.Rows(i)("时间") / 60
            Next
            DataGrid1.DataSource = dv
            DataGrid1.DataBind()
            q.close()
            Present_weekday()
        End If


    End Sub

    Private Sub DataGrid1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGrid1.SelectedIndexChanged

    End Sub

    Private Sub LinkButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LinkButton1.Click
        Response.Redirect("SelfScore.aspx")
    End Sub
End Class

⌨️ 快捷键说明

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