레지스트리에도 키값을 추가 함
This commit is contained in:
@@ -114,6 +114,8 @@ Public Class MDiMain
|
|||||||
|
|
||||||
Private Sub MDiMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
|
Private Sub MDiMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'제목표시줄에 프로그램명과 버젼을 표시합니다
|
'제목표시줄에 프로그램명과 버젼을 표시합니다
|
||||||
Me.Text = My.Application.Info.ProductName & " Ver. {0}.{1:00}.{2}.{3}"
|
Me.Text = My.Application.Info.ProductName & " Ver. {0}.{1:00}.{2}.{3}"
|
||||||
Me.Text = System.String.Format(Me.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor, My.Application.Info.Version.Build, My.Application.Info.Version.Revision)
|
Me.Text = System.String.Format(Me.Text, My.Application.Info.Version.Major, My.Application.Info.Version.Minor, My.Application.Info.Version.Build, My.Application.Info.Version.Revision)
|
||||||
@@ -366,6 +368,42 @@ Public Class MDiMain
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function ReadAuth() As Boolean
|
Private Function ReadAuth() As Boolean
|
||||||
|
|
||||||
|
Dim reg_install, reg_installkey As Long
|
||||||
|
|
||||||
|
'//레지스트리랑 비교한다.
|
||||||
|
Dim MainKey As Microsoft.Win32.RegistryKey = My.Computer.Registry.CurrentUser.OpenSubKey("Software\FileManager")
|
||||||
|
If MainKey Is Nothing Then
|
||||||
|
reg_install = 0
|
||||||
|
reg_installkey = 0
|
||||||
|
MainKey = My.Computer.Registry.CurrentUser.CreateSubKey("Software\FileManager")
|
||||||
|
MainKey.SetValue("install", reg_install)
|
||||||
|
MainKey.SetValue("installkey", reg_installkey)
|
||||||
|
MainKey.Close()
|
||||||
|
Else
|
||||||
|
Dim v_install As Object = MainKey.GetValue("install")
|
||||||
|
Dim v_key As Object = MainKey.GetValue("installkey")
|
||||||
|
|
||||||
|
MainKey.Close()
|
||||||
|
|
||||||
|
MainKey = My.Computer.Registry.CurrentUser.CreateSubKey("Software\FileManager")
|
||||||
|
If Not v_install Is Nothing Then
|
||||||
|
reg_install = CType(v_install, Long)
|
||||||
|
Else
|
||||||
|
reg_install = 0
|
||||||
|
MainKey.SetValue("install", reg_install)
|
||||||
|
End If
|
||||||
|
If Not v_key Is Nothing Then
|
||||||
|
reg_installkey = CType(v_key, Long)
|
||||||
|
Else
|
||||||
|
reg_installkey = 0
|
||||||
|
MainKey.SetValue("installkey", reg_installkey)
|
||||||
|
End If
|
||||||
|
MainKey.Close()
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If install = 0 OrElse installkey = 0 Then
|
If install = 0 OrElse installkey = 0 Then
|
||||||
' MsgBox("인증정보가 존재하지 않습니다." & vbCrLf & vbCrLf & "홈페이지 [자료실] 에서 인증번호를 확인하세요" & vbCrLf & "062-382-0411" & vbCrLf & Common.HomePage, MsgBoxStyle.Critical, "확인")
|
' MsgBox("인증정보가 존재하지 않습니다." & vbCrLf & vbCrLf & "홈페이지 [자료실] 에서 인증번호를 확인하세요" & vbCrLf & "062-382-0411" & vbCrLf & Common.HomePage, MsgBoxStyle.Critical, "확인")
|
||||||
'Process.Start(HomePage)
|
'Process.Start(HomePage)
|
||||||
@@ -394,6 +432,14 @@ Public Class MDiMain
|
|||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'//레지키와비교
|
||||||
|
If install <> reg_install OrElse installkey <> reg_installkey Then
|
||||||
|
' MsgBox("인증정보가 존재하지 않습니다." & vbCrLf & vbCrLf & "홈페이지 [자료실] 에서 인증번호를 확인하세요" & vbCrLf & "062-382-0411" & vbCrLf & Common.HomePage, MsgBoxStyle.Critical, "확인")
|
||||||
|
'Process.Start(HomePage)
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Rundate = Date.FromFileTimeUtc(install)
|
Rundate = Date.FromFileTimeUtc(install)
|
||||||
|
|
||||||
Return True
|
Return True
|
||||||
|
|||||||
@@ -170,10 +170,19 @@ Public Class MyAuth '//각종인증방법을 이용한다.
|
|||||||
Arinini.Write("main", "install2", Newkey)
|
Arinini.Write("main", "install2", Newkey)
|
||||||
Arinini.Write("main", "installkey2", Newkey.GetHashCode)
|
Arinini.Write("main", "installkey2", Newkey.GetHashCode)
|
||||||
|
|
||||||
|
Dim key As Long = Newkey
|
||||||
|
Dim key2 As Long = CType(Newkey.GetHashCode(), Long)
|
||||||
|
|
||||||
|
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\FileManager", "install", key)
|
||||||
|
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\FileManager", "installkey", key2)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Dim A As New System.Text.StringBuilder
|
Dim A As New System.Text.StringBuilder
|
||||||
A.AppendLine("인증정보가 파일에 기록되었습니다")
|
A.AppendLine("인증정보가 파일에 기록되었습니다")
|
||||||
A.AppendLine("만기일 : " & Date.FromFileTimeUtc(Newkey))
|
A.AppendLine("만기일 : " & Date.FromFileTimeUtc(Newkey))
|
||||||
MsgBox(A.ToString, MsgBoxStyle.Information, "기록완료")
|
MsgBox(A.ToString, MsgBoxStyle.Information, "기록완료")
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user