-- 作者:kaituozhe
-- 发布时间:2020/2/13 10:14:00
--
Dim n As Integer = Registry.GetValue("HKEY_CURRENT_USER\\Software\\MyApp","Count",1) Dim Code As String = Registry.GetValue("HKEY_CURRENT_USER\\Software\\MyApp", "Register" & ComputerId, "") Dim Ok As Boolean If Code > "" AndAlso DecryptText(Code,"123456789","123456789") = ComputerId Then \'如果注册码正确 OK = True Else Forms("注册").Open() Code = Registry.GetValue("HKEY_CURRENT_USER\\Software\\MyApp", "Register" & ComputerId, "") If Code > "" AndAlso DecryptText(Code,"123456789","123456789") = ComputerId Then \'如果注册码正确 OK = True Else Syscmd.Project.Exit() Return End If End If Registry.SetValue("HKEY_CURRENT_USER\\Software\\MyApp","Count",n + 1) If OK = False Then Syscmd.Project.Exit() Return End If With FileWatcher .Path = ProjectPath & "RemoteFiles\\" .Filter = "*.*" .Delay = 1000 .Enabled = True End With
Forms("用户登录").Open() If _UserName = "" Then Syscmd.Project.Exit() Return \'这个要加上,因为既然要退出,就不应该再执行后面的初始化代码了,否则会出错 End If
If User.Type <> UserTypeEnum.Developer AndAlso _UserName <> "牛合军" Then TableCaptionVisible = False RibbonTabs("Table").Visible = False RibbonTabs("Project").Visible = False RibbonTabs("Print").Visible = False RibbonTabs("Other").Visible = False RibbonTabs.HideTabHeaderRow = True basemainform.windowstate = 0 basemainform.width = SysInfo.WorkingAreaWidth basemainform.height = SysInfo.WorkingAreaHeight End If
Dim tb As DataTable = DataTables("基本情况") Dim nms2 As new List (of String ) If tb.find("项目= \'开始日期\'")("内容") = "" Then MessageBox.show("请先打开基本情况窗口设置基本信息","提示") Else For y As Integer = CDate(tb.find("项目= \'开始日期\'")("内容")).Year To CDate(tb.find("项目= \'截止日期\'")("内容")).Year nms2.Add(y) Next kuaijiqijian = nms2 End If
With FileWatcher .Path = "D:\\高拍文件" .Delay = 1000 .Enabled = True End With
|