Dim config As String = Environment.currentdirectory & "\config.xml"
If FileSys.FileExists(config) = False Then
e.HideSplashForm = True
MessageBox.show("系统项目文件丢失,无法打开此项目,请重新安装系统或者联系厂家!")
e.Cancel=True
Else
Dim xmlpath As String = "System/DecryptCode"
Dim xmlDoc As New System.XML.XmlDocument
xmlDoc.Load(config)
Dim xmlNd As System.XML.XmlNode = xmlDoc.SelectSingleNode(xmlpath)
Dim decCode As String = xmlNd.InnerText
Dim Val1 As String = computerID
Dim Val2 As String = EncryptText(Val1,"jugao","")
Val2= Val2.Substring(2,8)
Dim Val3 As String = EncryptText(Val2,"jugao","")
Val3= Val3.Substring(2,8)
Dim Val4 As String = EncryptText(Val3,"2015","")
Val4= Val4.Substring(2,8)
If decCode <> Val4 Then
Dim frm As New Form1
frm.ShowDialog() '模式打开
If bl_取消 Then
e.Cancel = True
End If
If bl_确定 Then
'你的策略
If str_注册码=Val4 Then
Dim config1 As String = Environment.currentdirectory & "\config.xml"
Dim xmlpath1 As String = "System/DecryptCode"
Dim xmlDoc1 As New System.XML.XmlDocument
xmlDoc1.Load(config1)
Dim xmlNd1 As System.XML.XmlNode = xmlDoc1.SelectSingleNode(xmlpath1)
xmlNd1.InnerText = str_注册码
xmlDoc1.save(config)
Else
If MessageBox.show("注册码错误,请联系软件开发者","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)=DialogResult.OK Then
e.Cancel=True
End If
End If
End If
End If
End If