项目BeforeOpenProject事件中写入下面的代码,打开项目前出现图中提示
If UKey.Start() Then
Dim jm As String
Dim pd As Boolean = False
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
cmd.CommandText = "SELECT * From {加密狗用户表} "
dt = cmd.ExecuteReader
If dt.DataRows.Count > 0 Then
jm = dt.DataRows(0)("加密字符")
For Each dr As DataRow In dt.DataRows
If UKey.Encrypt2(jm) <> dr("用户结果") Then
pd = True
Exit For
End If
Next
If pd = True Then
MessageBox.Show("请插上XX公司提供的UKey!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
End If
End If
Else
MessageBox.Show("启动UKey失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
End If
![dvubb 图片点击可在新窗口打开查看](skins/default/filetype/png.gif)
此主题相关图片如下:图1.png