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

📄 selfscore.aspx.vb

📁 VB.NET和SQLSERver2000编写在线考试系统
💻 VB
字号:
Public Class SelfScore
    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 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 message(ByVal str As String)
        Dim strscript As String = "<script language=javascript>alert('" & str & "')</script>"
        RegisterClientScriptBlock("系统消息", strscript)
    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
        End If
        Dim q As SqlClass = New SqlClass
        q.Open()
        Dim str As String

        str = "select * from 成绩登记表 where 用户名='" & Session("username") & "' and 当前状态='已交卷'"
        Dim Dt As DataTable = q.GetDataTable(str, "ID")
        Dim dv As DataView = New DataView(Dt)
        Dim i As Integer
        If dv.Count <> 0 Then
            For i = 0 To dv.Count - 1
                Dim u As Decimal = Dt.Rows(i)("时间") / 60
                Dt.Rows(i)("时间") = u
            Next

            DataGrid1.DataSource = dv
            DataGrid1.DataBind()
        Else
            message("没有成绩")
            DataGrid1.Visible = False
        End If

        q.close()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)


    End Sub

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

    End Sub
End Class

⌨️ 快捷键说明

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