以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 软件授权例子出错 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=26244) |
-- 作者:狐狸爸爸 -- 发布时间:2012/11/28 8:39:00 -- 你可以看看这个: http://www.foxtable.com/help/topics/1485.htm
找出错误代码位置,然后分析原因 |
-- 作者:lin_hailun -- 发布时间:2012/11/28 9:46:00 -- 按照二楼的方法排一下错吧。 再不行,联系客服远程协助解决。 |
-- 作者:狐狸爸爸 -- 发布时间:2012/11/28 10:44:00 -- If e.Form.Controls("DateTimePicker1").Value Is Nothing Then Return ElseIf e.Form.Controls("NumericComboBox1").Value Is Nothing Then Return ElseIf e.Form.Controls("TextBox1").Value Is Nothing Then Return End If Dim kh As String = e.Form.Controls("TextBox1").Text Dim rq As String = Format(e.Form.Controls("DateTimePicker1").Value,"yyyy-MM-dd") Dim cs As String = e.Form.Controls("NumericComboBox1").Value Dim qd As String = " " \'5个半角空格,用于初始化保存实际启动次数的存储器空间. Dim pw1 As String = "46DFA0D7" Dim pw2 As String = "C292C1DB" kh = kh.PadRight(50," ").SubString(0,50) \'客户名称最多50个字符,不够50用空格补 cs = cs.PadRight(5," ").Substring(0,5) \'启动次数最多允许5位数,不够的用空格补 If UKey.Start() Then If UKey.WriteStr(0,kh,pw1,pw2) AndAlso UKey.WriteStr(50,rq,pw1,pw2) AndAlso UKey.WriteStr(60,cs,pw1,pw2) AndAlso UKey.WriteStr(65,qd,pw1,pw2) Messagebox.Show("授权成功!","提示", MessageBoxButtons.OK,MessageBoxIcon.Information) Else Messagebox.Show("写入授权信息失败!","提示", MessageBoxButtons.OK,MessageBoxIcon.Information) End If Else Messagebox.Show("请插上UKey!","提示", MessageBoxButtons.OK,MessageBoxIcon.Information) End If |