因为用户名存储在外部数据源,所以在BeforeConnectOuterDataSource事件中加入了判断ukey是否启动的程序,这应该是程序启动最早的事件,希望在用户登录前就判断是否存在ukey。
程序如下:
If UKey.Start() Then
If UKey.Encrypt2("XXXsoft")<>"XXX900" Then
e.HideSplashForm=True
MessageBox.Show("启动UKey失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Syscmd.Project.Exit()
End If
Else
e.HideSplashForm=True
MessageBox.Show("请插上本软件的UKey!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
Syscmd.Project.Exit()
End If
两个问题:1、Syscmd.Project.Exit()不管用,仍会弹出用户登录窗口;
2、MessageBox.Show弹出时,总是不出现在最前端,若不是任务栏有提示,还真不知道弹出来了。