📄 全部代码.txt
字号:
End Try
End Sub
End Class
Public Class _error
Inherits System.Web.UI.Page
#Region " Web 窗体设计器生成的代码 "
'该调用是 Web 窗体设计器所必需的。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
'注意: 以下占位符声明是 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
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
Page.Response.Write(Request("errmsg"))
End Sub
End Class
Imports System.Web
Imports System.Web.SessionState
Public Class Global
Inherits System.Web.HttpApplication
#Region " 组件设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是组件设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'组件设计器所必需的
Private components As System.ComponentModel.IContainer
'注意: 以下过程是组件设计器所必需的
'可以使用组件设计器修改此过程。
'不要使用代码编辑器修改它。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
End Sub
#End Region
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' 在应用程序启动时激发
End Sub
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' 在会话启动时激发
End Sub
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
' 在每个请求开始时激发
End Sub
Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs)
' 尝试对使用进行身份验证时激发
End Sub
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' 在发生错误时激发
End Sub
Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
' 在会话结束时激发
End Sub
Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
' 在应用程序结束时激发
End Sub
End Class
Imports System.Data.SqlClient
Public Class login
Inherits System.Web.UI.Page
#Region " Web 窗体设计器生成的代码 "
'该调用是 Web 窗体设计器所必需的。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents btnLogin As System.Web.UI.WebControls.Button
Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm
Protected WithEvents txtAu_pwd As System.Web.UI.WebControls.TextBox
Protected WithEvents RequiredFieldValidator1 As System.Web.UI.WebControls.RequiredFieldValidator
Protected WithEvents lblIslog As System.Web.UI.WebControls.Label
Protected WithEvents txtAu_id As System.Web.UI.WebControls.TextBox
'注意: 以下占位符声明是 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
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
'Response.Write(Me.ClientID)
If Not Page.IsPostBack Then
Me.lblIslog.Visible = False
End If
End Sub
Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
Dim cLog As New CCheckLog(Me.txtAu_id.Text, Me.txtAu_pwd.Text)
If cLog.IsLogSuc = True Then
Session("UID") = Me.txtAu_id.Text
Page.Response.Redirect("userinfo.aspx")
Else
Me.txtAu_pwd.Text = ""
Me.txtAu_id.Text = ""
'Me.lblIslog.Text = "登陆失败!"
Me.lblIslog.Visible = True
End If
End Sub
End Class
'本代码用于获取当前登陆读者的 超期借阅记录
Imports System.Data.SqlClient
Public Class maxinfo
Inherits System.Web.UI.Page
#Region " Web 窗体设计器生成的代码 "
'该调用是 Web 窗体设计器所必需的。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents dbgborrowlist As System.Web.UI.WebControls.DataGrid
'注意: 以下占位符声明是 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
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
If Session("UID") Is Nothing Then
Page.Response.Redirect("login.aspx")
Else
If Not IsPostBack Then
mydatabind(Session("UID"))
End If
End If
End Sub
Function mydatabind(ByVal strAu_id As String)
Dim cnlib2004 As SqlConnection
Dim cmdAuBorrowList As SqlCommand
Dim dr As SqlDataReader
cnlib2004 = New SqlConnection(ConfigurationSettings.AppSettings("cncstr"))
cmdAuBorrowList = New SqlCommand
With cmdAuBorrowList
.CommandType = CommandType.StoredProcedure
.CommandText = "Select1AuMaxDateBookList"
.Connection = cnlib2004
End With
Dim mAu_id As New SqlParameter("@Au_id", SqlDbType.NVarChar, 50) '1
cmdAuBorrowList.Parameters.Add(mAu_id)
mAu_id.Value = strAu_id
Try
cnlib2004.Open()
dr = cmdAuBorrowList.ExecuteReader
Me.dbgborrowlist.DataSource = dr
Me.dbgborrowlist.DataBind()
Catch ex As Exception
Response.Redirect("error.aspx?errmsg=" + ex.Message)
Finally
cnlib2004.Close()
End Try
End Function
End Class
Imports System.Data.SqlClient
Public Class quebook
Inherits System.Web.UI.Page
#Region " Web 窗体设计器生成的代码 "
'该调用是 Web 窗体设计器所必需的。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
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 Label4 As System.Web.UI.WebControls.Label
Protected WithEvents Label5 As System.Web.UI.WebControls.Label
Protected WithEvents Label6 As System.Web.UI.WebControls.Label
Protected WithEvents Label7 As System.Web.UI.WebControls.Label
Protected WithEvents Label8 As System.Web.UI.WebControls.Label
Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm
Protected WithEvents Label9 As System.Web.UI.WebControls.Label
Protected WithEvents radAllBook As System.Web.UI.WebControls.RadioButton
Protected WithEvents radInlibBook As System.Web.UI.WebControls.RadioButton
Protected WithEvents txtBook_code As System.Web.UI.WebControls.TextBox
Protected WithEvents txtBook_name As System.Web.UI.WebControls.TextBox
Protected WithEvents txtBook_pub As System.Web.UI.WebControls.TextBox
Protected WithEvents txtBook_isbn As System.Web.UI.WebControls.TextBox
Protected WithEvents txtBook_author As System.Web.UI.WebControls.TextBox
Protected WithEvents dtpBook_pubdate As System.Web.UI.WebControls.TextBox
Protected WithEvents dbg As System.Web.UI.WebControls.DataGrid
Protected WithEvents btnQuery As System.Web.UI.WebControls.Button
Protected WithEvents cboBook_sort As System.Web.UI.WebControls.DropDownList
Protected WithEvents LabelInfo As System.Web.UI.WebControls.Label
Protected WithEvents RegularExpressionValidator1 As System.Web.UI.WebControls.RegularExpressionValidator
'注意: 以下占位符声明是 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
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
If Not IsPostBack Then
BindComboBox1()
End If
'Me.DataBind()
End Sub
Function BindComboBox1()
Dim cnLib2004 As SqlConnection
Dim cmdbooksort As SqlCommand
Dim drBooksort As SqlDataReader
cnLib2004 = New SqlConnection(ConfigurationSettings.AppSettings("cncstr"))
cmdbooksort = New SqlCommand
With cmdbooksort
.CommandType = CommandType.StoredProcedure
.Connection = cnLib2004
.CommandText = "selectBookSort"
End With
Try
cnLib2004.Open()
drBooksort = cmdbooksort.ExecuteReader
Me.cboBook_sort.DataSource = drBooksort
Me.cboBook_sort.DataTextField = "Book_sort"
Me.cboBook_sort.DataBind()
Me.cboBook_sort.Items.Add("全部类别")
Me.cboBook_sort.SelectedIndex = Me.cboBook_sort.Items.Count - 1
Catch ex As Exception
Response.Redirect("error.aspx?errmsg=" + ex.Message.Replace(Chr(13), "<BR>"))
Finally
cnLib2004.Close()
End Try
End Function
Function search()
Dim cn As New SqlClient.SqlConnection(ConfigurationSettings.AppSettings("cncstr"))
Dim cmd As New SqlCommand
Dim dr As SqlDataReader
With cmd
If Me.radAllBook.Checked = True Then
.CommandText = "searchBook"
Else
.CommandText = "searchBookInlib"
End If
.CommandType = CommandType.StoredProcedure
.Connection = cn
End With
Dim mBook_code As New SqlParameter("@Book_code", SqlDbType.NVarChar, 50) '1
Dim mBook_name As New SqlParameter("@Book_name", SqlDbType.NVarChar, 50) '2
Dim mBook_pub As New SqlParameter("@Book_pub", SqlDbType.NVarChar, 50) '3
Dim mBook_isbn As New SqlParameter("@Book_isbn", SqlDbType.NVarChar, 50) '4
Dim mBook_pubdate As New SqlParameter("@Book_pubdate", SqlDbType.SmallDateTime, 4) '5
Dim mBook_author As New SqlParameter("@Book_author", SqlDbType.NVarChar, 50) '6
Dim mBook_sort As New SqlParameter("@Book_sort", SqlDbType.NVarChar, 50) '11
With cmd.Parameters
.Add(mBook_code)
.Add(mBook_name)
.Add(mBook_pub)
.Add(mBook_isbn)
.Add(mBook_pubdate)
.Add(mBook_author)
.Add(mBook_sort)
End With
'赋值
mBook_code.Value = Me.txtBook_code.Text.Trim '1
mBook_name.Value = Me.txtBook_name.Text.Trim '2
mBook_pub.Value = Me.txtBook_pub.Text.Trim '3
mBook_isbn.Value = Me.txtBook_isbn.Text.Trim '4
If Me.dtpBook_pubdate.Text.Trim <> "" Then
mBook_pubdate.Value = CType(Me.dtpBook_pubdate.Text.Trim, Date) '5
Else
mBook_pubdate.Value = CType("1990-01-01", Date)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -