Imports System.Data.SqlClient
Imports System.IO
Public Class WebForm1
Inherits System.Web.UI.Page
Private connectingstring As String
Private myConn As SqlConnection
Private ds As DataSet
Private myAdapter As SqlDataAdapter
Protected WithEvents Button2 As System.Web.UI.WebControls.Button
Private myCmd As SqlCommand
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'在此处放置初始化页的用户代码
connectingstring = "data source=(local);Database=library;uid=sa;pwd=123456;"
myConn = New SqlConnection(connectingstring)
End Sub
Public Function CheckUserberInfo(ByVal Userstr As String, ByVal Pwdstr As String) As Integer
If myConn.State = ConnectionState.Closed Then
myConn.Open()
End If
Dim sqlstr As String
If Pwdstr = "" Then
sqlstr = "select * from Users where UserID='" + Userstr.Trim + "' and Pass is null"
Else
sqlstr = "select * from Users where UserID='" + Userstr.Trim + "' and Pass='" + Pwdstr + "'"
End If
Fill(sqlstr)
If ds.Tables(0).Rows.Count = 0 Then
Close()
Return -1
End If
ds.Clear()
Close()
Return 1
End Function
Public Sub Open()
myConn.Open()
End Sub
Public Sub Close()
myConn.Close()
<< 上一页 [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] ... 下一页 >>