收藏 分销(赏)

vbnet登录界面源代码教务标准管理系统.doc

上传人:精**** 文档编号:3024118 上传时间:2024-06-13 格式:DOC 页数:6 大小:39.04KB
下载 相关 举报
vbnet登录界面源代码教务标准管理系统.doc_第1页
第1页 / 共6页
vbnet登录界面源代码教务标准管理系统.doc_第2页
第2页 / 共6页
vbnet登录界面源代码教务标准管理系统.doc_第3页
第3页 / 共6页
vbnet登录界面源代码教务标准管理系统.doc_第4页
第4页 / 共6页
vbnet登录界面源代码教务标准管理系统.doc_第5页
第5页 / 共6页
点击查看更多>>
资源描述

1、Imports System.DataImports System.Data.OleDbPublic Class Login Inherits System.Windows.Forms.FormDim ServerLog As New AddServer Dim StrServer As String = ServerLog.TSever.Text Private Conn As New OleDbConnection(Integrated Security=SSPI;Packet Size=4096;Data Source= & StrServer & ;Tag with column co

2、llation when possible=False;Initial Catalog=ys;Use Procedure for Prepare=1;Auto Translate=True;Persist Security Info=False;Provider=SQLOLEDB.1;Workstation ID= & StrServer & ;Use Encryption for Data=False) Private DC As New OleDbConnection Private DA As New OleDbDataAdapter Private DS As New DataSet

3、Dim Adminform As New Administrator Dim stuform As New student Dim Teaform As New Teacher Private Function Query(ByVal QueryString As String) As Boolean DS.Clear() Try DA = New OleDbDataAdapter(QueryString, Conn) DA.Fill(DS, TMInfo) Catch MessageBox.Show(Err.Description, 警告, _ MessageBoxButtons.OK, M

4、essageBoxIcon.Warning) Exit Function End Try Dim dt As New DataTable dt = DS.Tables.Item(0) If account.Text = Or passwords.Text = Then MessageBox.Show( 账号或密码不能为空, 提醒信息, MessageBoxButtons.OK, MessageBoxIcon.Information) Return False ElseIf dt.Rows.Count = 0 Then 错误 MessageBox.Show( _ 您输入账号不存在, _ 警告,

5、MessageBoxButtons.OK, MessageBoxIcon.Error) Return False End If Dim row As Data.DataRow 定义一个表格行对象。 row = dt.Rows.Item(0) 将表格第一行即密码读出 passwords.Text = row.Item(password) If passwords.Text row.Item(password) Then 用户密码不正确 MessageBox.Show( _ 对不起,您密码有误。, _ 警告, MessageBoxButtons.OK, MessageBoxIcon.Error)

6、Return False End If Return True End Function Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim QueryString As String QueryString = select * from TeaMagInfo where id= & account.Text & If account.Text = Administrator And passwords.Text = pa

7、ss Then Dim Addserv As New AddServer Addserv.ShowDialog() Else If (Query(QueryString) = True) Then Try DA = New OleDbDataAdapter(QueryString, Conn) DA.Fill(DS, TMInfo) Catch MessageBox.Show(Err.Description, 警告, _ MessageBoxButtons.OK, MessageBoxIcon.Warning) Exit Sub End Try Dim dt As New DataTable

8、dt = DS.Tables.Item(0) Dim row As Data.DataRow 定义一个表格行对象。 row = dt.Rows.Item(0) If RadioAdmin.Checked Then If row.Item(ocu) 管理员.ToString Then MessageBox.Show(你选择用户类型不正确, 提醒信息, MessageBoxButtons.OK, MessageBoxIcon.Information) Else Adminform.Show() Me.Visible = False End If End If If RadioTeacher.Che

9、cked Then If row.Item(ocu) 老师.ToString Then MessageBox.Show(你选择用户类型不正确, 提醒信息, MessageBoxButtons.OK, MessageBoxIcon.Information) Else Me.Visible = False Me.DialogResult = DialogResult.OK Teaform.Show() Me.Visible = False End If End If End If End If If Radiostu.Checked Then DS.Clear() If account.Text

10、= Or passwords.Text = Then MessageBox.Show( 账号或密码不能为空, 提醒信息, MessageBoxButtons.OK, MessageBoxIcon.Information) Else Dim stu As Boolean = False Dim QuerString As String QuerString = select * from stuBaseInfo where stuID= & account.Text & and password= & passwords.Text & Try DA = New OleDbDataAdapter(

11、QuerString, Conn) DA.Fill(DS, lk) Dim dtab As DataTable dtab = DS.Tables.Item(lk) If dtab.Rows.Count 0 Then stu = True Else MessageBox.Show(不存在此账号信息或原始密码错, 提醒信息, MessageBoxButtons.OK, MessageBoxIcon.Information) End If Catch ex As Exception MessageBox.Show(Err.Description, 警告, MessageBoxButtons.OKCa

12、ncel, MessageBoxIcon.Warning) End Try If stu Then stuform.Show() Me.Visible = False End If End If End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal

13、e As System.EventArgs) Handles MyBase.Load Me.AcceptButton = Button1 Me.CancelButton = Button2 End Sub Private Sub OleDbConnection1_InfoMessage(ByVal sender As System.Object, ByVal e As System.Data.OleDb.OleDbInfoMessageEventArgs) End Sub Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Radiostu.CheckedChanged End Sub Private Sub RadioTeacher_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioTeacher.CheckedChanged End SubEnd Class

展开阅读全文
部分上传会员的收益排行 01、路***(¥15400+),02、曲****(¥15300+),
03、wei****016(¥13200+),04、大***流(¥12600+),
05、Fis****915(¥4200+),06、h****i(¥4100+),
07、Q**(¥3400+),08、自******点(¥2400+),
09、h*****x(¥1400+),10、c****e(¥1100+),
11、be*****ha(¥800+),12、13********8(¥800+)。
相似文档                                   自信AI助手自信AI助手
百度文库年卡

猜你喜欢                                   自信AI导航自信AI导航
搜索标签

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服