直接用文档存取密码??你不是说笑吧!!!!!!!!
那这样的话,我就更支持用注册表了!!
这样不是更安全
洒家靠!悟空:我给你说过N遍了,叫你不要说我帅!虽然我承认我很帅!!
我也刚学 错误之处请指出
我的代码跟楼上的兄弟不一样
那是因为我是纯代码的
只要把代码复制就可以用了
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim dt12 As DataTable
Dim conn12 As New OleDb.OleDbConnection(strConnect = "Provider=SQLOLEDB;User ID=sa;password=;database=数据库名;server=服务器名"
Dim da12 As New OleDb.OleDbDataAdapter("select * from CommomEmployee", conn12)
da12.TableMappings.Add("Table12", "CommomEmployee")
conn12.Open()
Dim ds12 As New DataSet
da12.Fill(ds12, "Table12")
dt12 = ds12.Tables("CommomEmployee") ’如果用水晶报表时 da12为数据源 dt12为数据集
Dim iRowCount12 As Integer
Dim flag12 As Boolean = False
For iRowCount12 = 0 To dt12.Rows.Count - 1 ‘从数据集第一行搜索到最后一行
If dt12.Rows.Item(iRowCount12)("ID").ToString.Trim = txt1.Text And dt12.Rows.Item(iRowCount12)("PostCard").ToString.Trim = txt2.Text Then
flag12 = True
End If
Next
if flag12=Ture Then
dim form2 as new form2 ‘form2为第二个窗口
me.close()
form2.show()
Else
MsgBox("输入错误或帐号不存在!", MsgBoxStyle.Exclamation)
txt1.Clear()
txt2.Clear()
cmb1.Text = ""
End If
conn12.Close()
Catch ex As Exception
MsgBox("系统发生错误,请确定操作正确!" & ex.ToString, MsgBoxStyle.Critical)
End Try
End Sub
cmb1.txt 代表什么?Catch不能出现在Try语句之外又是什么意思?strConnect又该这样声名??高手速答,好不?