-- 作者:mamuaiqing
-- 发布时间:2013/7/23 10:00:00
-- 项目BeforeOpenProject事件
项目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 此主题相关图片如下:图1.png
|
-- 作者:mamuaiqing
-- 发布时间:2013/7/23 10:21:00
--
感谢Bin老师,因为项目中要用到多个Ukey,每个的加密结果都不一样,难道只能用帮助文件那样,也要写多个加密结果?
If
UKey.Start() Then If
UKey.Encrypt2("abc") <> "483DBF9FDD0574C0"
Then MessageBox.Show("请插上XX公司提供的UKey!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) e.Cancel = True End
If Else MessageBox.Show("启动UKey失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) e.Cancel = True End
If
|