?? formuglicensepatch.vb
字號:
Imports System.Windows.Forms
Public Class FormUGLicensePatch
Dim strUGLicensePath As String
Private Sub AboutProgram(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAbout.Click
MessageBox.Show("UG NX4 License 運行服務器補丁" & ControlChars.CrLf & _
" 程序設計:熊巨輝" & ControlChars.CrLf & _
" deaton@21cn.com" & ControlChars.CrLf & _
" 2008/11/08", "關于服務器補丁", MessageBoxButtons.OK, _
MessageBoxIcon.Information, _
MessageBoxDefaultButton.Button1, _
MessageBoxOptions.DefaultDesktopOnly, False)
End Sub
Private Sub FindManager(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonManager.Click
Dim ofdManager As New OpenFileDialog
With ofdManager
.Title = "定位服務器啟動文件"
.Multiselect = False
.CheckFileExists = True
.CheckPathExists = True
.Filter = "啟動文件|lmgrd.exe"
.InitialDirectory = strUGLicensePath
.ShowDialog()
strUGLicensePath = .FileName
TextBoxManager.Text = .FileName
End With
SaveSetting(My.Application.Info.ProductName, My.Application.Info.Title, "Manager", TextBoxManager.Text)
End Sub
Private Sub FormLoad(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
strUGLicensePath = Application.StartupPath
TextBoxManager.Text = GetSetting(My.Application.Info.ProductName, My.Application.Info.Title, "Manager")
TextBoxLicense.Text = GetSetting(My.Application.Info.ProductName, My.Application.Info.Title, "License")
TextBoxLog.Text = GetSetting(My.Application.Info.ProductName, My.Application.Info.Title, "Log")
CheckBoxAutoRun.Checked = CBool(GetSetting(My.Application.Info.ProductName, My.Application.Info.Title, "AutoRun", False))
If CheckBoxAutoRun.Checked Then RunService()
End Sub
Private Sub AutoRun(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBoxAutoRun.CheckedChanged
SaveSetting(My.Application.Info.ProductName, My.Application.Info.Title, "AutoRun", CheckBoxAutoRun.Checked)
End Sub
Private Sub CloseMe(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonOK.Click
If Not String.IsNullOrEmpty(TextBoxManager.Text) Then RunService()
End Sub
Private Sub RunService()
Dim procLicense As New Process()
Me.Visible = False
With procLicense
.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
.StartInfo.Arguments = _
" -c " & Chr(34) & GetSetting(My.Application.Info.ProductName, My.Application.Info.Title, "License") & Chr(34) _
& " -l " & Chr(34) & GetSetting(My.Application.Info.ProductName, My.Application.Info.Title, "Log") & Chr(34)
.StartInfo.FileName = GetSetting(My.Application.Info.ProductName, My.Application.Info.Title, "Manager")
.Start()
End With
Application.Exit()
End Sub
Private Sub FindLicense(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonLicense.Click
Dim ofdLicense As New OpenFileDialog
With ofdLicense
.Title = "定位用戶授權文件"
.Multiselect = False
.CheckFileExists = True
.CheckPathExists = True
.Filter = "授權文件|*.lic"
.InitialDirectory = strUGLicensePath
.ShowDialog()
strUGLicensePath = .FileName
TextBoxLicense.Text = .FileName
End With
SaveSetting(My.Application.Info.ProductName, My.Application.Info.Title, "License", TextBoxManager.Text)
End Sub
Private Sub FindLog(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonLog.Click
Dim ofdLog As New OpenFileDialog
With ofdLog
.Title = "定位服務器運行日志"
.Multiselect = False
.CheckFileExists = True
.CheckPathExists = True
.Filter = "日志文件|*.log"
.InitialDirectory = strUGLicensePath
.ShowDialog()
strUGLicensePath = .FileName
TextBoxLog.Text = .FileName
End With
SaveSetting(My.Application.Info.ProductName, My.Application.Info.Title, "License", TextBoxManager.Text)
End Sub
End Class
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -