....
This commit is contained in:
@@ -7,9 +7,9 @@ Imports System.Threading
|
||||
Public Class MDiMain
|
||||
|
||||
Public NewList As Boolean = False '//파일을 불러오거나 편집모드를 켯을떄변경
|
||||
|
||||
Dim auth As New MyAuth
|
||||
Dim FB As New FolderBrowserDialog
|
||||
|
||||
Dim install, installkey As Long
|
||||
Dim strbuff As New System.Text.StringBuilder
|
||||
Dim Macro() As Str_Macro
|
||||
|
||||
@@ -172,6 +172,32 @@ Public Class MDiMain
|
||||
|
||||
Me.Src_Init()
|
||||
|
||||
|
||||
'//인증사용안함 191125 -
|
||||
LoadAuthData()
|
||||
If Command() <> "ARIN" AndAlso Not ReadAuth() Then '//에러났을떄는 카운터를 확인
|
||||
'//사용횟수가 10번ㅇ르 초과했는지 확인
|
||||
Runcnt = Me.ReadAuthcount
|
||||
Dim f As New fAuth()
|
||||
If (f.ShowDialog <> System.Windows.Forms.DialogResult.OK) Then
|
||||
End
|
||||
End If
|
||||
'If Runcnt >= 10 Then
|
||||
' Dim NewKey As String = InputBox("인증번호를 입력하세요 (인증번호는 숫자로만 이루어져 있습니다)")
|
||||
' If IsNumeric(NewKey) = False Then
|
||||
' MsgBox("프로그램을 재실행 하세요", MsgBoxStyle.Information, "확인")
|
||||
' End
|
||||
' End If
|
||||
' auth.SetAuth(NewKey, My.Application.Info.DirectoryPath & "\epole.ini")
|
||||
' MsgBox("프로그램을 재실행 하세요", MsgBoxStyle.Information, "확인")
|
||||
' End
|
||||
'Else
|
||||
' MsgBox(CStr(10 - Runcnt) & "번의 사용횟수가 남았습니다", MsgBoxStyle.Critical, "실행확인")
|
||||
'End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
'//가져올부분은 작업폴더/백업폴더/백업폴더2/확장자/서브디렉토리참조/백업정책1/백업정책2/중복정책/실행형태/검사형태
|
||||
Me.tb_workdir.Text = ini.Read("main", "workdir", "c:\")
|
||||
Me.desd_tb_path.Text = ini.Read("main", "desdir", "c:\")
|
||||
@@ -289,6 +315,99 @@ Public Class MDiMain
|
||||
|
||||
PLog.Add("Load Setting OK", True)
|
||||
End Sub
|
||||
|
||||
|
||||
Private Function LoadAuthData() As Boolean
|
||||
|
||||
Me.lb_msg.Text = "Read Auth Data"
|
||||
Dim Arinini As New MyINI2(My.Application.Info.DirectoryPath & "\data.ini")
|
||||
Dim buf() As String
|
||||
|
||||
If Not Arinini.Exist Then
|
||||
'//파일이없는건 오류
|
||||
installkey = -1
|
||||
install = 1
|
||||
End If
|
||||
Try
|
||||
'//파일이 잇으면 그값ㅇ르 가져온다
|
||||
Me.install = Arinini.Read("main", "install2", 0)
|
||||
Me.installkey = Arinini.Read("main", "installkey2", 0)
|
||||
Catch ex As Exception
|
||||
installkey = -1
|
||||
install = 1
|
||||
End Try
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
Private Function ReadAuthcount() As Integer
|
||||
Dim RunCnt As Integer = 0
|
||||
Dim ini As New MyINI2(My.Application.Info.DirectoryPath & "\data.ini")
|
||||
Dim RegDate As String = ini.Read("main", "regdate2", "")
|
||||
Dim CurDate As String = Me.auth.GetDateNumberEnc(Today.AddDays(-10))
|
||||
If RegDate = "" Then '//등록일이없으면 10번카운터를 셋팅한다.
|
||||
RunCnt = 10
|
||||
ini.Write("main", "reg2", RunCnt) '//1일로한다.
|
||||
ini.Write("main", "regdate2", Me.auth.GetDateNumberEnc(Today)) '//1일로한다.
|
||||
Else
|
||||
'//상요자가 숫자를 임의로 고칠수있으니 설치된 날짜랑 오늘이랑 10일이상차이나면 횟수에상관없이 사용불가로한다.
|
||||
If CurDate > RegDate Then
|
||||
MsgBox("프로그램을 사용할 수 없습니다" & vbCrLf & "배포업체에 문의하세요", MsgBoxStyle.Information, "확인")
|
||||
Return 10
|
||||
End If
|
||||
RunCnt = ini.Read("main", "reg2", 10) '//없으면 10으로한다 즉 사용못하게하겠다는거다
|
||||
If RunCnt < 10 Then
|
||||
RunCnt += 1
|
||||
ini.Write("main", "reg2", RunCnt) '//1일로한다.
|
||||
End If
|
||||
End If
|
||||
If RunCnt >= 10 Then Return 10
|
||||
Return RunCnt
|
||||
End Function
|
||||
|
||||
Private Function ReadAuth() As Boolean
|
||||
If install = 0 OrElse installkey = 0 Then
|
||||
' MsgBox("인증정보가 존재하지 않습니다." & vbCrLf & vbCrLf & "홈페이지 [자료실] 에서 인증번호를 확인하세요" & vbCrLf & "062-382-0411" & vbCrLf & Common.HomePage, MsgBoxStyle.Critical, "확인")
|
||||
'Process.Start(HomePage)
|
||||
Return False
|
||||
End If
|
||||
|
||||
Dim 현재날짜값 As Long = auth.GetDateNumber(Now)
|
||||
|
||||
If 현재날짜값 > install Then
|
||||
' MsgBox("사용기간이 초과되었습니다." & vbCrLf & vbCrLf & "홈페이지 [자료실] 에서 인증번호를 확인하세요" & vbCrLf & "062-382-0411" & vbCrLf & Common.HomePage, MsgBoxStyle.Critical, "확인")
|
||||
'Process.Start(HomePage)
|
||||
Return False '//만기일을 초과했다면
|
||||
End If
|
||||
|
||||
'Dim FI As New System.IO.FileInfo(My.Application.Info.DirectoryPath & "\epole.ini")
|
||||
'If (auth.GetDateNumber(FI.LastAccessTimeUtc)) > Now.ToFileTimeUtc Then '//설정파일을 접근한 날짜가 오늘보다 크면 즉 오늘이 조작디었을경우다
|
||||
' ' MsgBox("사용기간이 초과되었습니다." & vbCrLf & vbCrLf & "홈페이지 [자료실] 에서 인증번호를 확인하세요" & vbCrLf & "062-382-0411" & vbCrLf & Common.HomePage, MsgBoxStyle.Critical, "확인")
|
||||
' 'Process.Start(HomePage)
|
||||
' Return False '//만기일을 초과했다면
|
||||
'End If
|
||||
|
||||
Dim 해쉬값 As Integer = install.GetHashCode()
|
||||
If installkey.ToString <> 해쉬값 Then '//인증정보가 손상되었다면
|
||||
' MsgBox("인증정보가 손상되었습니다" & vbCrLf & vbCrLf & "홈페이지 [자료실] 에서 인증번호를 확인하세요" & vbCrLf & "062-382-0411" & vbCrLf & Common.HomePage, MsgBoxStyle.Critical, "확인")
|
||||
'Process.Start(HomePage)
|
||||
Return False
|
||||
End If
|
||||
|
||||
Rundate = Date.FromFileTimeUtc(install)
|
||||
|
||||
Return True
|
||||
' MsgBox(auth.GetDateNumberEnc(Now))
|
||||
End Function
|
||||
|
||||
Private Sub SetAuth(ByVal NewDate As Date)
|
||||
Dim auth As New MyAuth
|
||||
Dim Arinini As New MyINI2(My.Application.Info.DirectoryPath & "\data.ini")
|
||||
Arinini.Write("main", "install2", auth.GetDateNumber(NewDate))
|
||||
Arinini.Write("main", "installkey2", auth.GetDateNumberEnc(NewDate))
|
||||
|
||||
MsgBox("기록완료")
|
||||
End Sub
|
||||
Private Function Setting_Save(Optional ByVal Macroindex As Integer = 0) As Boolean '//현재 셋팅을 저장합니다.
|
||||
'//저장목록은 시작/종료 열번호 아이템의 텍스트이다.
|
||||
|
||||
@@ -538,10 +657,19 @@ NewName:
|
||||
End If
|
||||
|
||||
If tb_workdir.Text.StartsWith("ftp:/") Then
|
||||
If btCopy.Pressed = False Then
|
||||
MsgBox("FTP를 원본으로 사용할 때에는 '이동/삭제' 작업을 할 수 없습니다", MsgBoxStyle.Critical, "확인")
|
||||
Return True
|
||||
|
||||
If IsPro Then
|
||||
If btCopy.Pressed = False AndAlso btDel.Pressed = False Then
|
||||
MsgBox("FTP를 원본으로 사용할 때에는 '이동' 작업을 할 수 없습니다", MsgBoxStyle.Critical, "확인")
|
||||
Return True
|
||||
End If
|
||||
Else
|
||||
If btCopy.Pressed = False Then
|
||||
MsgBox("FTP를 원본으로 사용할 때에는 '이동/삭제' 작업을 할 수 없습니다", MsgBoxStyle.Critical, "확인")
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
|
||||
Else
|
||||
If Directory.Exists(Me.tb_workdir.Text) = False Then
|
||||
MsgBox("지정된 작업폴더가 존재하지 않거나" & vbCrLf & "경로에 문제가있습니다", MsgBoxStyle.Critical, "확인")
|
||||
@@ -1118,6 +1246,15 @@ dname:
|
||||
If Check_InputError() Then Return
|
||||
Me.Timer1.Enabled = False
|
||||
|
||||
If btDel.Pressed AndAlso chkAutoRun.Checked Then
|
||||
If MsgBox("삭제 작업이면서 자동실행이 설정되어 있습니다. 작업을 진행 할까요?", MsgBoxStyle.Information + MsgBoxStyle.YesNo, "실행확인") <> MsgBoxResult.Yes Then Return
|
||||
End If
|
||||
|
||||
If chkAutoRun.Checked AndAlso tb_workdir.Text.StartsWith("ftp:/") Then
|
||||
If MsgBox("FTP의경우 백업정책이 적용되지 않습니다" + Environment.NewLine + "진행 하시겠습니까?", MsgBoxStyle.Information + MsgBoxStyle.YesNo, "실행확인") <> MsgBoxResult.Yes Then Return
|
||||
End If
|
||||
|
||||
|
||||
Dim startP As Integer = Integer.Parse(tb_sttrange.Text) '//시작줄
|
||||
Dim endP As Integer = GetLastRowCount() '//종료줄
|
||||
Dim WorkDir As String = GetWorkDIr()
|
||||
@@ -1414,5 +1551,20 @@ dname:
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub C1Ribbon1_RibbonEvent(sender As System.Object, e As C1.Win.C1Ribbon.RibbonEventArgs) Handles C1Ribbon1.RibbonEvent
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub MDiMain_KeyDown(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
|
||||
If e.KeyCode = Keys.F12 AndAlso e.Control Then
|
||||
If ETCLOGIN.ShowDialog = System.Windows.Forms.DialogResult.OK Then
|
||||
' Me.bt_others.Visible = True
|
||||
IsPro = True
|
||||
Else
|
||||
IsPro = False
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
|
||||
Reference in New Issue
Block a user