登录窗体Form1:I mports System.Data Imports System.Data.SqlClient Public Class Form1 Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click Dim myconn As New SqlConnection("UID=sa;password=sa;database=图书管理系统;server=(Local)") Dim str1 As String = "select工号,密码from管理员where工号='" & TextBox1.Text & "'and密码='" & TextBox2.Text & "'" Dim str2 As String = "select读者ID,密码from读者where读者ID='" & TextBox1.Text & "'and密码='" & TextBox2.Text & "'"用户名= TextBox1.Text If RadioButton1.Checked Then Dim mycmd As New SqlCommand(str1, myconn) myconn.Open() Dim myReader As SqlDataReader myReader = mycmd.ExecuteReader() If myReader.HasRows = False Then MsgBox("用户名或密码错误!请确认后再登录!") TextBox1.Text = "" TextBox2.Text = "" TextBox1.Focus() Else Form2.Show() Me.Hide() End If ElseIf RadioButton2.Checked Then Dim mycmd As New SqlCommand(str2, myconn) myc