diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..51ef408
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/\[NET2\]ArinSetting/*.suo
+/\[NET2\]ArinLog/*.suo
diff --git a/DriveInfo.suo b/DriveInfo.suo
index b9d41c1..665fdf8 100644
Binary files a/DriveInfo.suo and b/DriveInfo.suo differ
diff --git a/DriveInfo/DriveInfo.vbproj b/DriveInfo/DriveInfo.vbproj
index 52c80e5..cb1da0f 100644
--- a/DriveInfo/DriveInfo.vbproj
+++ b/DriveInfo/DriveInfo.vbproj
@@ -46,7 +46,7 @@
full
true
true
- ..\..\Runtime\FileManager\
+ ..\..\..\..\HaeGwang\FileManager\
42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355
@@ -57,7 +57,7 @@
false
true
true
- ..\..\Runtime\FileManager\
+ ..\..\..\..\HaeGwang\FileManager\
42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355
@@ -90,6 +90,8 @@
..\CommonClassv2.dll
+
+
@@ -124,16 +126,30 @@
True
ireaDataSet.xsd
+
+ ETCLOGIN.vb
+
+
+ Form
+
+
+ fAuth.vb
+
+
+ Form
+
fFtpPath.vb
Form
+
+
-
+
Form_Status.vb
@@ -190,6 +206,12 @@
+
+ ETCLOGIN.vb
+
+
+ fAuth.vb
+
fFtpPath.vb
diff --git a/DriveInfo/ETCLOGIN.Designer.vb b/DriveInfo/ETCLOGIN.Designer.vb
new file mode 100644
index 0000000..3fd0886
--- /dev/null
+++ b/DriveInfo/ETCLOGIN.Designer.vb
@@ -0,0 +1,80 @@
+ _
+Partial Class ETCLOGIN
+ Inherits System.Windows.Forms.Form
+
+ 'Form은 Dispose를 재정의하여 구성 요소 목록을 정리합니다.
+ _
+ Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+ Try
+ If disposing AndAlso components IsNot Nothing Then
+ components.Dispose()
+ End If
+ Finally
+ MyBase.Dispose(disposing)
+ End Try
+ End Sub
+ Friend WithEvents PasswordTextBox As System.Windows.Forms.TextBox
+ Friend WithEvents OK As System.Windows.Forms.Button
+ Friend WithEvents Cancel As System.Windows.Forms.Button
+
+ 'Windows Form 디자이너에 필요합니다.
+ Private components As System.ComponentModel.IContainer
+
+ '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다.
+ '수정하려면 Windows Form 디자이너를 사용하십시오.
+ '코드 편집기를 사용하여 수정하지 마십시오.
+ _
+ Private Sub InitializeComponent()
+ Me.PasswordTextBox = New System.Windows.Forms.TextBox
+ Me.OK = New System.Windows.Forms.Button
+ Me.Cancel = New System.Windows.Forms.Button
+ Me.SuspendLayout()
+ '
+ 'PasswordTextBox
+ '
+ Me.PasswordTextBox.Location = New System.Drawing.Point(21, 12)
+ Me.PasswordTextBox.Name = "PasswordTextBox"
+ Me.PasswordTextBox.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42)
+ Me.PasswordTextBox.Size = New System.Drawing.Size(220, 21)
+ Me.PasswordTextBox.TabIndex = 3
+ '
+ 'OK
+ '
+ Me.OK.Location = New System.Drawing.Point(21, 39)
+ Me.OK.Name = "OK"
+ Me.OK.Size = New System.Drawing.Size(94, 23)
+ Me.OK.TabIndex = 4
+ Me.OK.Text = "확인(&O)"
+ '
+ 'Cancel
+ '
+ Me.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
+ Me.Cancel.Location = New System.Drawing.Point(147, 39)
+ Me.Cancel.Name = "Cancel"
+ Me.Cancel.Size = New System.Drawing.Size(94, 23)
+ Me.Cancel.TabIndex = 5
+ Me.Cancel.Text = "취소(&C)"
+ '
+ 'ETCLOGIN
+ '
+ Me.AcceptButton = Me.OK
+ Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 12.0!)
+ Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+ Me.CancelButton = Me.Cancel
+ Me.ClientSize = New System.Drawing.Size(258, 78)
+ Me.Controls.Add(Me.Cancel)
+ Me.Controls.Add(Me.OK)
+ Me.Controls.Add(Me.PasswordTextBox)
+ Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
+ Me.MaximizeBox = False
+ Me.MinimizeBox = False
+ Me.Name = "ETCLOGIN"
+ Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide
+ Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
+ Me.Text = "암호입력"
+ Me.ResumeLayout(False)
+ Me.PerformLayout()
+
+ End Sub
+
+End Class
diff --git a/DriveInfo/ETCLOGIN.resx b/DriveInfo/ETCLOGIN.resx
new file mode 100644
index 0000000..19dc0dd
--- /dev/null
+++ b/DriveInfo/ETCLOGIN.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/DriveInfo/ETCLOGIN.vb b/DriveInfo/ETCLOGIN.vb
new file mode 100644
index 0000000..4d31285
--- /dev/null
+++ b/DriveInfo/ETCLOGIN.vb
@@ -0,0 +1,51 @@
+Public Class ETCLOGIN
+
+ ' TODO: 제공된 사용자 이름과 암호를 사용하여 사용자 지정 인증을 수행하는 코드를 삽입합니다
+ ' (자세한 내용은 http://go.microsoft.com/fwlink/?LinkId=35339 참조).
+ ' 그러면 사용자 지정 보안 주체가 현재 스레드의 보안 주체에 다음과 같이 첨부될 수 있습니다.
+ ' My.User.CurrentPrincipal = CustomPrincipal
+ ' 여기서 CustomPrincipal은 인증을 수행하는 데 사용되는 IPrincipal이 구현된 것입니다.
+ ' 나중에 My.User는 CustomPrincipal 개체에 캡슐화된 사용자 이름, 표시 이름 등의
+ ' ID 정보를 반환합니다.
+ Public PASS As String
+
+ Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
+ If Me.PasswordTextBox.Text = "gorhkd" & Format(Now, "yyyyMMdd") Then
+ Me.DialogResult = System.Windows.Forms.DialogResult.OK
+ Me.Close()
+ Else
+ MsgBox("암호가 일치하지 않습니다", MsgBoxStyle.Critical, "확인")
+ Me.PasswordTextBox.Focus()
+ Me.PasswordTextBox.SelectAll()
+ End If
+ End Sub
+
+ Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
+ Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
+ Me.Close()
+ End Sub
+
+ Private Sub PasswordTextBox_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles PasswordTextBox.KeyDown
+ If e.KeyCode = Keys.Enter Then
+
+ ' MsgBox("gorhkd" & Format(Now, "yyyyMMdd"))
+ If Me.PasswordTextBox.Text = "gorhkd" & Format(Now, "yyyyMMdd") Then
+
+ Me.DialogResult = System.Windows.Forms.DialogResult.OK
+ Me.Close()
+ Else
+ MsgBox("암호가 일치하지 않습니다", MsgBoxStyle.Critical, "확인")
+ Me.PasswordTextBox.Focus()
+ Me.PasswordTextBox.SelectAll()
+ End If
+ End If
+ End Sub
+
+ Private Sub PasswordTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PasswordTextBox.TextChanged
+
+ End Sub
+
+ Private Sub ETCLOGIN_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
+
+ End Sub
+End Class
diff --git a/DriveInfo/MDiMain.Designer.vb b/DriveInfo/MDiMain.Designer.vb
index 4bcd41e..1a4e7d9 100644
--- a/DriveInfo/MDiMain.Designer.vb
+++ b/DriveInfo/MDiMain.Designer.vb
@@ -264,6 +264,7 @@ Partial Class MDiMain
Me.list_subdir.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader1, Me.ColumnHeader2})
Me.list_subdir.Dock = System.Windows.Forms.DockStyle.Fill
Me.list_subdir.FullRowSelect = True
+ Me.list_subdir.HideSelection = False
Me.list_subdir.Location = New System.Drawing.Point(3, 28)
Me.list_subdir.Name = "list_subdir"
Me.list_subdir.Size = New System.Drawing.Size(199, 524)
@@ -1564,6 +1565,7 @@ Partial Class MDiMain
Me.lvSchedule.Dock = System.Windows.Forms.DockStyle.Fill
Me.lvSchedule.FullRowSelect = True
Me.lvSchedule.GridLines = True
+ Me.lvSchedule.HideSelection = False
Me.lvSchedule.Location = New System.Drawing.Point(3, 3)
Me.lvSchedule.Name = "lvSchedule"
Me.lvSchedule.Size = New System.Drawing.Size(1078, 555)
@@ -1610,6 +1612,7 @@ Partial Class MDiMain
Me.Controls.Add(Me.TabControl1)
Me.Controls.Add(Me.C1StatusBar1)
Me.Controls.Add(Me.C1Ribbon1)
+ Me.KeyPreview = True
Me.Name = "MDiMain"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "파일관리자 최종수정일 : 2008-09-17 09:51 PM (tindevil@nate.com)"
diff --git a/DriveInfo/MDiMain.vb b/DriveInfo/MDiMain.vb
index 6cff756..7343208 100644
--- a/DriveInfo/MDiMain.vb
+++ b/DriveInfo/MDiMain.vb
@@ -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
diff --git a/DriveInfo/My Project/AssemblyInfo.vb b/DriveInfo/My Project/AssemblyInfo.vb
index 5495cc2..1fafd7d 100644
--- a/DriveInfo/My Project/AssemblyInfo.vb
+++ b/DriveInfo/My Project/AssemblyInfo.vb
@@ -33,5 +33,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
'
-
-
+
+
diff --git a/DriveInfo/MyAuth.vb b/DriveInfo/MyAuth.vb
new file mode 100644
index 0000000..d17fa8e
--- /dev/null
+++ b/DriveInfo/MyAuth.vb
@@ -0,0 +1,496 @@
+
+
+
+Imports System.Security.Cryptography
+
+Public Class EnDec
+
+ Private TripleDes As New TripleDESCryptoServiceProvider
+ Sub New(ByVal key As String)
+ ' Initialize the crypto provider.
+ TripleDes.Key = TruncateHash(key, TripleDes.KeySize \ 8)
+ TripleDes.IV = TruncateHash("", TripleDes.BlockSize \ 8)
+ End Sub
+
+ Private Function TruncateHash(
+ ByVal key As String,
+ ByVal length As Integer) _
+ As Byte()
+
+ Dim sha1 As New SHA1CryptoServiceProvider
+
+ ' Hash the key.
+ Dim keyBytes() As Byte =
+ System.Text.Encoding.Unicode.GetBytes(key)
+ Dim hash() As Byte = sha1.ComputeHash(keyBytes)
+
+ ' Truncate or pad the hash.
+ ReDim Preserve hash(length - 1)
+ Return hash
+ End Function
+
+ '''
+ ''' 문자열의 암호화
+ '''
+ '''
+ '''
+ '''
+ Public Function EncryptData(
+ ByVal plaintext As String) _
+ As String
+
+ ' Convert the plaintext string to a byte array.
+ Dim plaintextBytes() As Byte =
+ System.Text.Encoding.Unicode.GetBytes(plaintext)
+
+ ' Create the stream.
+ Dim ms As New System.IO.MemoryStream
+ ' Create the encoder to write to the stream.
+ Dim encStream As New CryptoStream(ms,
+ TripleDes.CreateEncryptor(),
+ System.Security.Cryptography.CryptoStreamMode.Write)
+
+ ' Use the crypto stream to write the byte array to the stream.
+ encStream.Write(plaintextBytes, 0, plaintextBytes.Length)
+ encStream.FlushFinalBlock()
+
+ ' Convert the encrypted stream to a printable string.
+ Return Convert.ToBase64String(ms.ToArray)
+ End Function
+
+ '''
+ ''' 복호화'
+ '''
+ '''
+ '''
+ '''
+ Public Function DecryptData(
+ ByVal encryptedtext As String) _
+ As String
+
+ ' Convert the encrypted text string to a byte array.
+ Dim encryptedBytes() As Byte = Convert.FromBase64String(encryptedtext)
+
+ ' Create the stream.
+ Dim ms As New System.IO.MemoryStream
+ ' Create the decoder to write to the stream.
+ Dim decStream As New CryptoStream(ms,
+ TripleDes.CreateDecryptor(),
+ System.Security.Cryptography.CryptoStreamMode.Write)
+
+ ' Use the crypto stream to write the byte array to the stream.
+ decStream.Write(encryptedBytes, 0, encryptedBytes.Length)
+ decStream.FlushFinalBlock()
+
+ ' Convert the plaintext stream to a string.
+ Return System.Text.Encoding.Unicode.GetString(ms.ToArray, 0, ms.Length)
+ End Function
+
+ '''
+ ''' 파일로부터 문자열을 읽어옵니다.
+ '''
+ '''
+ '''
+ Public Function Read_STring(ByVal Filename As String) As String
+ Dim FI As New System.IO.FileInfo(Filename)
+ If FI.Exists = False Then
+ MsgBox("필수파일이 존재하지않습니다", MsgBoxStyle.Critical, "확인")
+ Return ""
+ End If
+
+ Dim FS As New System.IO.FileStream(FI.FullName, IO.FileMode.Open)
+ Dim SR As New System.IO.StreamReader(FS, System.Text.Encoding.Default)
+
+ Dim cipherText As String = SR.ReadToEnd
+ SR.Close()
+ FS.Close()
+
+ ' DecryptData throws if the wrong password is used.
+ Try
+ Dim plainText As String = DecryptData(cipherText)
+ Return plainText
+ 'MsgBox("해독값은? " & plainText)
+ Catch ex As System.Security.Cryptography.CryptographicException
+ Return ""
+ MsgBox("암호화키가 일치하지않거나 기타 오류입니다")
+ End Try
+
+ End Function
+
+ '''
+ ''' 파일에 해당 문자열을 기록합니다.
+ '''
+ '''
+ '''
+ '''
+ Public Sub Write_String(ByVal Filename As String, ByVal Contents As String)
+ Dim cipherText As String = EncryptData(Contents)
+
+ Dim FI As New System.IO.FileInfo(Filename)
+ Dim FS As New System.IO.FileStream(FI.FullName, IO.FileMode.Create)
+ Dim SW As New System.IO.StreamWriter(FS, System.Text.Encoding.Default)
+ 'MsgBox("암호화된값은? " & cipherText)
+ SW.Write(cipherText)
+ SW.Flush()
+ SW.Close()
+ FS.Close()
+ End Sub
+
+
+End Class
+Public Class MyAuth '//각종인증방법을 이용한다.
+ Public Function GetDateAuth(ByVal 만기일자 As Date) As Boolean '//날짜인증시 사용가능한지
+ '//사용가능한 날짜인지 확인하고 만약 날짜정보가 없으면은 날짜를 setdataeauth 를 실행합니다
+ '//인터넷에 연결되어있을시 현재 시간정보를 인터넷에서 받아온ㄷ
+ '//콘솔의 현재날짜가 설치된 날짜보다 더 뒤일경우 사용중지
+ '//레지 파일의 기록날짜가 서로다를경우 사용중지
+ '//레지,파일의 기록날짜가 동일하고 콘솔의 현재날짜가 기한을 넘지않았을경우에만 true 한다.
+ Dim isAvailable As Boolean = My.Computer.Network.IsAvailable '//인터넷사용여부
+ Dim CurrentDate As Date
+
+ If isAvailable Then '//인터넷에서 날짜정보를 가져온다 기록된 날짜와 오늘의 날짜를 확인한다.
+ Dim Itime As Date
+ Try
+ CurrentDate = Itime
+ Catch ex As Exception '//에러발생시 콘솔날짜로 세팅한다.
+ CurrentDate = Now
+ End Try
+ Else
+ MsgBox("인터넷사용불가")
+ CurrentDate = Now
+ End If
+
+ If 만기일자 > CurrentDate Then Return False
+ Return True
+ End Function
+
+ Public Sub SetAuth(ByVal Newkey As Long, ByVal Fn As String)
+ ' Dim auth As New ARINCLASS
+ Dim Arinini As New MyINI2(Fn)
+ Arinini.Write("main", "install2", Newkey)
+ Arinini.Write("main", "installkey2", Newkey.GetHashCode)
+
+ Dim A As New System.Text.StringBuilder
+ A.AppendLine("인증정보가 파일에 기록되었습니다")
+ A.AppendLine("만기일 : " & Date.FromFileTimeUtc(Newkey))
+ MsgBox(A.ToString, MsgBoxStyle.Information, "기록완료")
+ End Sub
+
+
+ '''
+ ''' 미지원 함수
+ '''
+ '''
+ '''
+ Public Function SetDateAuth() As Boolean '//레지와 파일에 해당 인증정보를 기록합니다
+ Return True
+ End Function
+
+ '''
+ ''' 미지원함수
+ '''
+ '''
+ '''
+ Public Function GetCurrentDate() As Date '//오늘날짜를 가져옵니다
+ Return Now
+ End Function
+
+ Public Function GetDateNumber(ByVal 시작일 As Date) As Long
+ Return 시작일.ToFileTimeUtc
+ End Function
+
+ Public Function GetDateNumberEnc(ByVal 시작일 As Date) As String
+ Return 시작일.ToFileTimeUtc.ToString.GetHashCode '//날짜로 들어가면 날짜의 해쉬코드를 넘겨준다.
+ End Function
+
+ Public Function GetDateNumberEnc(ByVal 시작일 As Long) As String
+ Return 시작일.ToString.GetHashCode
+ End Function
+
+End Class
+
+Public Class MyINI2
+ Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
+ Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpDownFileName As String) As Integer
+ 'Private Aname As String
+ Public FileName As String = vbNullString
+ Private FileNameBuf As String
+ Private m_sPath As String
+ Private m_sKey As String
+ Private m_sSection As String
+ Private m_sDefault As String
+ Private m_lLastReturnCode As Integer
+
+ Public Sub New(ByVal File As String)
+ FileName = File
+ FileNameBuf = File
+ Me.Create()
+
+ 'MsgBox("New 1=" & FileName & vbCrLf & "2=" & FileNameBuf)
+
+ ' If Not System.IO.File.Exists(File) Then System.IO.File.Create(File)
+ End Sub
+ Public Sub Create()
+ If Exist() = True Then Return
+ Dim A As New IO.FileInfo(FileName)
+ A.Directory.Create()
+ Dim FS As IO.FileStream = A.Create()
+ Dim SW As New IO.StreamWriter(FS, System.Text.Encoding.Default)
+ SW.WriteLine("//Myini 로부터 자동생성된 파일입니다")
+ SW.WriteLine("//생성일자 : " & Now.ToString)
+ SW.Flush()
+ SW.Close()
+ FS.Close()
+ SW = Nothing
+ FS = Nothing
+ FileName = FileNameBuf
+ End Sub
+ Public Function Exist() As Boolean
+ Return System.IO.File.Exists(FileName)
+ End Function
+
+ Public Function Read(ByVal appkey As String, ByVal subkey As String, Optional ByVal DefaultValue As String = vbNullString) As String '//변수초기화
+ 'MsgBox("Read 1=" & FileName & vbCrLf & "2=" & FileNameBuf)
+
+ Dim tempstr As Integer 'ini파일에서 읽어온 값을 임시저장하는 변수
+ Dim strtemp As String = New String(Chr(0), 2000) 'ini파일의 임시 변수
+ Dim Tempbuf As String
+
+ If Not Exist() Then
+ MsgBox("환경파일이 존재하지 않습니다" & vbCrLf & "APP=" & appkey & vbCrLf & "subkey=" & subkey & vbCrLf & "파일명=" & FileName, MsgBoxStyle.Critical, "Error")
+ Return vbNullString
+ End If
+ Try
+ tempstr = GetPrivateProfileString(appkey, subkey, "", strtemp, Len(strtemp), FileName)
+ Tempbuf = strtemp.Substring(0, tempstr)
+ Tempbuf = Tempbuf.Trim(Chr(0))
+
+ FileName = FileNameBuf
+
+ If Tempbuf.Trim = vbNullString AndAlso DefaultValue <> vbNullString Then
+ Return DefaultValue
+ Else
+ Return Tempbuf
+ End If
+ Catch ex As Exception
+ FileName = FileNameBuf
+ Return vbNullString
+ End Try
+
+ End Function
+ Public Function ReadFile(ByVal appkey As String, ByVal subkey As String, ByVal filename2 As String, Optional ByVal DefaultValue As String = vbNullString) As String '//변수초기화
+ 'MsgBox("ReadFile 1=" & FileName & vbCrLf & "2=" & FileNameBuf)
+ Dim tempstr As Integer 'ini파일에서 읽어온 값을 임시저장하는 변수
+ Dim strtemp As String = New String(Chr(0), 2000) 'ini파일의 임시 변수
+ Dim Tempbuf As String
+
+ If Not System.IO.File.Exists(filename2) Then
+ MsgBox("환경파일이 존재하지 않습니다" & vbCrLf & "파일명=" & FileName, MsgBoxStyle.Critical, "Error")
+ Return vbNullString
+ End If
+
+ Try
+ tempstr = GetPrivateProfileString(appkey, subkey, "", strtemp, Len(strtemp), filename2)
+ Tempbuf = strtemp.Substring(0, tempstr)
+ If Tempbuf.Trim = vbNullString AndAlso DefaultValue <> vbNullString Then
+ Return DefaultValue
+ Else
+ Return Tempbuf
+ End If
+ Catch ex As Exception
+ Return vbNullString
+ End Try
+ FileName = FileNameBuf
+ End Function
+
+ Public Function Write(ByVal appkey As String, ByVal subkey As String, ByVal WriteVal As Object) As Integer
+ Dim RetVal As Integer
+ 'MsgBox("Write1 1=" & FileName & vbCrLf & "2=" & FileNameBuf)
+ If Not Exist() Then
+ MsgBox("환경파일이 존재하지 않습니다" & vbCrLf & "파일을 생성합니다." & vbCrLf & "파일명=" & FileName, MsgBoxStyle.Information, "확인")
+ Me.Create()
+ End If
+ ' FileName = Aname
+ RetVal = (WritePrivateProfileString(appkey, subkey, WriteVal, FileName))
+ FileName = FileNameBuf
+ Return RetVal
+
+ End Function
+ Public Sub Write(ByVal appkey As String, ByVal subkey As String, ByVal WriteVal As Object, ByVal fileName2 As String)
+ 'MsgBox("Write2 1=" & FileName & vbCrLf & "2=" & FileNameBuf)
+ If Not System.IO.File.Exists(fileName2) Then
+ MsgBox("[D] 환경파일이 존재하지 않습니다" & vbCrLf & "파일을 생성합니다." & vbCrLf & "파일명=" & fileName2, MsgBoxStyle.Information, "확인")
+ System.IO.File.Create(fileName2)
+ End If
+ WritePrivateProfileString(appkey, subkey, WriteVal, fileName2)
+ FileName = FileNameBuf
+ End Sub
+
+
+
+ Public Sub EnumerateCurrentSection(ByRef sKey() As String, ByRef iCount As Integer)
+ Dim sSection As String
+ Dim iPos As Integer
+ Dim iNextPos As Integer
+ Dim sCur As String
+
+ iCount = 0
+ Erase sKey
+ sSection = INISection
+ If (Len(sSection) > 0) Then
+ iPos = 1
+ iNextPos = InStr(iPos, sSection, Chr(0))
+ Do While iNextPos <> 0
+ sCur = Mid(sSection, iPos, iNextPos - iPos)
+ If (sCur <> Chr(0)) Then
+ iCount = iCount + 1
+ 'UPGRADE_WARNING: sKey 배열의 하한이 1에서 0(으)로 변경되었습니다. 자세한 내용은 다음을 참조하십시오. 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="0F1C9BE1-AF9D-476E-83B1-17D43BECFF20"'
+ ReDim Preserve sKey(iCount)
+ sKey(iCount) = Mid(sSection, iPos, iNextPos - iPos)
+ iPos = iNextPos + 1
+ iNextPos = InStr(iPos, sSection, Chr(0))
+ End If
+ Loop
+ End If
+ End Sub
+
+
+ Public Sub GetAllsection(ByVal key As String, ByRef Section As ArrayList, ByRef Value As ArrayList)
+ Dim FS As New System.IO.FileStream(FileName, FileMode.Open)
+ Dim SR As New StreamReader(FS, System.Text.Encoding.Default)
+ Dim Findkey As String = "[" & key & "]"
+ Dim Line As String
+ Dim KeyPos As Integer = -1
+ Dim Seppos As Integer = -1
+ While SR.Peek > -1
+ Line = SR.ReadLine
+ If KeyPos = -1 Then '//키를 못찻았으면
+ If Line.ToUpper.IndexOf(Findkey.ToUpper) > -1 Then KeyPos = Line.ToUpper.IndexOf(Findkey.ToUpper)
+ Else '//찾앗으면
+ If Line.IndexOf("[") = -1 Then '//그다음 키가 오기전까지 모두 추가한다.
+ Seppos = Line.IndexOf("=")
+ Section.Add(Line.Substring(0, Seppos))
+ Value.Add(Line.Substring(Seppos + 1))
+ Else
+ Exit While
+ End If
+ End If
+ End While
+
+ SR.Close()
+ FS.Close()
+
+
+ End Sub
+
+ Public Sub EnumerateAllSections(ByRef sSections() As String, ByRef iCount As Integer)
+ Dim sIniFile As String
+ Dim iPos As Integer
+ Dim iNextPos As Integer
+ Dim sCur As String
+
+ iCount = 0
+ Erase sSections
+ sIniFile = Sections
+ If (Len(sIniFile) > 0) Then
+ iPos = 1
+ iNextPos = InStr(iPos, sIniFile, Chr(0))
+ Do While iNextPos <> 0
+ If (iNextPos <> iPos) Then
+ sCur = Mid(sIniFile, iPos, iNextPos - iPos)
+ iCount = iCount + 1
+ 'UPGRADE_WARNING: sSections 배열의 하한이 1에서 0(으)로 변경되었습니다. 자세한 내용은 다음을 참조하십시오. 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="0F1C9BE1-AF9D-476E-83B1-17D43BECFF20"'
+ ReDim Preserve sSections(iCount)
+ sSections(iCount) = sCur
+ End If
+ iPos = iNextPos + 1
+ iNextPos = InStr(iPos, sIniFile, Chr(0))
+ Loop
+ End If
+
+ End Sub
+
+ Property INISection() As String
+ Get
+ Dim sBuf As String
+ Dim iSize As String
+ Dim iRetCode As Short
+
+ sBuf = Space(8192)
+ iSize = CStr(Len(sBuf))
+ iRetCode = GetPrivateProfileString(m_sSection, 0, m_sDefault, sBuf, CInt(iSize), m_sPath)
+ If (CDbl(iSize) > 0) Then
+ INISection = Left(sBuf, iRetCode)
+ Else
+ INISection = ""
+ End If
+
+ End Get
+ Set(ByVal Value As String)
+ m_lLastReturnCode = WritePrivateProfileString(m_sSection, 0, Value, m_sPath)
+ End Set
+ End Property
+ ReadOnly Property Sections() As String
+ Get
+ Dim sBuf As String
+ Dim iSize As String
+ Dim iRetCode As Short
+
+ sBuf = Space(8192)
+ iSize = CStr(Len(sBuf))
+ iRetCode = GetPrivateProfileString(0, 0, m_sDefault, sBuf, CInt(iSize), m_sPath)
+ If (CDbl(iSize) > 0) Then
+ Sections = Left(sBuf, iRetCode)
+ Else
+ Sections = ""
+ End If
+
+ End Get
+ End Property
+
+ ReadOnly Property LastReturnCode() As Integer
+ Get
+ LastReturnCode = m_lLastReturnCode
+ End Get
+ End Property
+ ReadOnly Property Success() As Boolean
+ Get
+ Success = (m_lLastReturnCode <> 0)
+ End Get
+ End Property
+ 'UPGRADE_NOTE: Default이(가) Default_Renamed(으)로 업그레이드되었습니다. 자세한 내용은 다음을 참조하십시오. 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="A9E4979A-37FA-4718-9994-97DD76ED70A7"'
+ Property Default_Renamed() As String
+ Get
+ Default_Renamed = m_sDefault
+ End Get
+ Set(ByVal Value As String)
+ m_sDefault = Value
+ End Set
+ End Property
+ Property Path() As String
+ Get
+ Path = m_sPath
+ End Get
+ Set(ByVal Value As String)
+ m_sPath = Value
+ End Set
+ End Property
+ Property Key() As String
+ Get
+ Key = m_sKey
+ End Get
+ Set(ByVal Value As String)
+ m_sKey = Value
+ End Set
+ End Property
+ Property Section() As String
+ Get
+ Section = m_sSection
+ End Get
+ Set(ByVal Value As String)
+ m_sSection = Value
+ End Set
+ End Property
+
+
+End Class
\ No newline at end of file
diff --git a/DriveInfo/fAuth.Designer.vb b/DriveInfo/fAuth.Designer.vb
new file mode 100644
index 0000000..247c4e9
--- /dev/null
+++ b/DriveInfo/fAuth.Designer.vb
@@ -0,0 +1,142 @@
+ _
+Partial Class fAuth
+ Inherits System.Windows.Forms.Form
+
+ 'Form은 Dispose를 재정의하여 구성 요소 목록을 정리합니다.
+ _
+ Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+ Try
+ If disposing AndAlso components IsNot Nothing Then
+ components.Dispose()
+ End If
+ Finally
+ MyBase.Dispose(disposing)
+ End Try
+ End Sub
+
+ 'Windows Form 디자이너에 필요합니다.
+ Private components As System.ComponentModel.IContainer
+
+ '참고: 다음 프로시저는 Windows Form 디자이너에 필요합니다.
+ '수정하려면 Windows Form 디자이너를 사용하십시오.
+ '코드 편집기를 사용하여 수정하지 마십시오.
+ _
+ Private Sub InitializeComponent()
+ Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(fAuth))
+ Me.Label1 = New System.Windows.Forms.Label()
+ Me.Label2 = New System.Windows.Forms.Label()
+ Me.Label3 = New System.Windows.Forms.Label()
+ Me.TextBox1 = New System.Windows.Forms.TextBox()
+ Me.Label4 = New System.Windows.Forms.Label()
+ Me.LinkLabel1 = New System.Windows.Forms.LinkLabel()
+ Me.Button1 = New System.Windows.Forms.Button()
+ Me.Button2 = New System.Windows.Forms.Button()
+ Me.SuspendLayout()
+ '
+ 'Label1
+ '
+ Me.Label1.AutoSize = True
+ Me.Label1.Font = New System.Drawing.Font("굴림", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(129, Byte))
+ Me.Label1.Location = New System.Drawing.Point(17, 19)
+ Me.Label1.Name = "Label1"
+ Me.Label1.Size = New System.Drawing.Size(298, 16)
+ Me.Label1.TabIndex = 0
+ Me.Label1.Text = "현재 남은 사용 횟수는 {0} 회 입니다."
+ '
+ 'Label2
+ '
+ Me.Label2.AutoSize = True
+ Me.Label2.Font = New System.Drawing.Font("굴림", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(129, Byte))
+ Me.Label2.Location = New System.Drawing.Point(17, 55)
+ Me.Label2.Name = "Label2"
+ Me.Label2.Size = New System.Drawing.Size(303, 12)
+ Me.Label2.TabIndex = 1
+ Me.Label2.Text = "프로그램을 영구 사용하려면 인증키를 입력하세요."
+ '
+ 'Label3
+ '
+ Me.Label3.AutoSize = True
+ Me.Label3.ForeColor = System.Drawing.Color.Red
+ Me.Label3.Location = New System.Drawing.Point(17, 75)
+ Me.Label3.Name = "Label3"
+ Me.Label3.Size = New System.Drawing.Size(341, 12)
+ Me.Label3.TabIndex = 1
+ Me.Label3.Text = "지정 횟수를 초과하면 더 이상 프로그램을 사용할 수 없습니다."
+ '
+ 'TextBox1
+ '
+ Me.TextBox1.Font = New System.Drawing.Font("굴림", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(129, Byte))
+ Me.TextBox1.Location = New System.Drawing.Point(19, 133)
+ Me.TextBox1.Name = "TextBox1"
+ Me.TextBox1.Size = New System.Drawing.Size(367, 29)
+ Me.TextBox1.TabIndex = 1
+ '
+ 'Label4
+ '
+ Me.Label4.AutoSize = True
+ Me.Label4.Location = New System.Drawing.Point(37, 104)
+ Me.Label4.Name = "Label4"
+ Me.Label4.Size = New System.Drawing.Size(37, 12)
+ Me.Label4.TabIndex = 3
+ Me.Label4.Text = "문의 :"
+ '
+ 'LinkLabel1
+ '
+ Me.LinkLabel1.AutoSize = True
+ Me.LinkLabel1.Location = New System.Drawing.Point(79, 103)
+ Me.LinkLabel1.Name = "LinkLabel1"
+ Me.LinkLabel1.Size = New System.Drawing.Size(283, 12)
+ Me.LinkLabel1.TabIndex = 4
+ Me.LinkLabel1.TabStop = True
+ Me.LinkLabel1.Text = "해광기획 (http://hawgwang.co.kr) / 062-381-0411"
+ '
+ 'Button1
+ '
+ Me.Button1.Location = New System.Drawing.Point(392, 133)
+ Me.Button1.Name = "Button1"
+ Me.Button1.Size = New System.Drawing.Size(68, 29)
+ Me.Button1.TabIndex = 2
+ Me.Button1.Text = "인증"
+ Me.Button1.UseVisualStyleBackColor = True
+ '
+ 'Button2
+ '
+ Me.Button2.Location = New System.Drawing.Point(19, 170)
+ Me.Button2.Name = "Button2"
+ Me.Button2.Size = New System.Drawing.Size(441, 29)
+ Me.Button2.TabIndex = 0
+ Me.Button2.Text = "테스트 사용"
+ Me.Button2.UseVisualStyleBackColor = True
+ '
+ 'fAuth
+ '
+ Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 12.0!)
+ Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+ Me.ClientSize = New System.Drawing.Size(478, 219)
+ Me.Controls.Add(Me.Button2)
+ Me.Controls.Add(Me.Button1)
+ Me.Controls.Add(Me.LinkLabel1)
+ Me.Controls.Add(Me.Label4)
+ Me.Controls.Add(Me.TextBox1)
+ Me.Controls.Add(Me.Label3)
+ Me.Controls.Add(Me.Label2)
+ Me.Controls.Add(Me.Label1)
+ Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
+ Me.MaximizeBox = False
+ Me.MinimizeBox = False
+ Me.Name = "fAuth"
+ Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
+ Me.Text = "인증하기"
+ Me.ResumeLayout(False)
+ Me.PerformLayout()
+
+ End Sub
+ Friend WithEvents Label1 As System.Windows.Forms.Label
+ Friend WithEvents Label2 As System.Windows.Forms.Label
+ Friend WithEvents Label3 As System.Windows.Forms.Label
+ Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
+ Friend WithEvents Label4 As System.Windows.Forms.Label
+ Friend WithEvents LinkLabel1 As System.Windows.Forms.LinkLabel
+ Friend WithEvents Button1 As System.Windows.Forms.Button
+ Friend WithEvents Button2 As System.Windows.Forms.Button
+End Class
diff --git a/DriveInfo/fAuth.resx b/DriveInfo/fAuth.resx
new file mode 100644
index 0000000..1bd80a8
--- /dev/null
+++ b/DriveInfo/fAuth.resx
@@ -0,0 +1,175 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+
+ AAABAAIAICAQAAAAAADoAgAAJgAAACAgAAAAAAAAqAgAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAAAIAC
+ AAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwACAgIAAAAD/AAD/
+ AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAERAQEBAAAAAAAAAAAAABEREREREBAQAAAAAAAAABESE
+ hISEhIRAQAAAAAAAAEiIiEhISEhIRIQAAAAAAASIiIiIiIiEhICIQAAAAABIiIiEBAQEBAhEiIQAAAAE
+ iIh4dH///3cEgHiIQAAASIiHh4hC//cgiESHiIQAAEiIeHh4dH/3CIiEeHiEAASIh4eHh4R/9wiIhHeH
+ iEAEiHh4eHh0f/cIeIR3eHhABIeHh4eHhH/3CIiEd3eIQEh4eHd3d3R/9wh4gnd3eIRHh4d3d3d0f/cI
+ iEd3d4eESHh3d3d3dH/3CIhHd3d4hEeHd3d3d3R/9wiCh3d3d4RId3d3d3d0f/cIhHd3d3h0R3d3d3dy
+ Qn/3CEd3d3d3hEh3d3d3dP//9wiHd3d3eHRHd3d3d3dEf/cEd3d3d3eEBHd3d3d3d0f3B/d3d3d3gAR3
+ d3d/f3dwB093d3d3d0AEd3d3d3d4RASH93d3d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AAP/4AAB/4A
+ AA/8AAA/+AAAH/AAAA/gAAAHwAAAA8AAAAOAAAABgAAAAYAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+ AAAAAAAAAAAAAIAAAAGAAAABgAAAAcAAAAPAAAAD4AAAB/AAAA/4AAAf/AAAP/4AAH//gAH///AP/w==
+
+
+
\ No newline at end of file
diff --git a/DriveInfo/fAuth.vb b/DriveInfo/fAuth.vb
new file mode 100644
index 0000000..8fc730c
--- /dev/null
+++ b/DriveInfo/fAuth.vb
@@ -0,0 +1,64 @@
+Public Class fAuth
+ Private Sub fAuth_Load(sender As Object, e As EventArgs) Handles MyBase.Load
+ ' Runcnt = Me.ReadAuthcount
+ If Runcnt > 9 Then
+ Button2.Text = "사용횟수초과(테스트사용불가)"
+ Button2.Enabled = False
+ End If
+ Dim remain As Integer = 10 - Runcnt
+ Label1.Text = String.Format(Label1.Text, remain)
+
+ End Sub
+ Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
+ Dim url As String = "http://haegwang.co.kr"
+ Dim prc As New System.Diagnostics.Process()
+ Dim si As New System.Diagnostics.ProcessStartInfo(url)
+ prc.StartInfo = si
+ prc.Start()
+ End Sub
+
+ Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
+ DialogResult = System.Windows.Forms.DialogResult.OK
+ End Sub
+
+ Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
+ Dim NewKey As String = TextBox1.Text.Trim()
+ If NewKey.Trim() = "" Then
+ TextBox1.Focus()
+ TextBox1.SelectAll()
+ Return
+ End If
+
+ Dim textenc As New EnDec("HAEGWANGSIMP")
+ Try
+ Dim strdata As String = textenc.DecryptData(TextBox1.Text.Trim())
+ Dim strbuf() As String = strdata.Split("|SIMP|")
+ Dim datestr As String = strbuf(0)
+ Dim datestrhash As String = strbuf(2)
+ Dim hashcode As Integer = CInt(datestrhash)
+ Dim dateHash As Integer = datestr.GetHashCode()
+
+ If datestr.GetHashCode() = hashcode Then
+ Dim auth As New MyAuth
+ Dim dateValue As Date = Date.Parse(datestr)
+ auth.SetAuth(dateValue.ToFileTimeUtc(), My.Application.Info.DirectoryPath & "\data.ini")
+ MsgBox("프로그램을 재실행 하세요", MsgBoxStyle.Information, "확인")
+ DialogResult = System.Windows.Forms.DialogResult.Cancel
+ Else
+ MsgBox("프로그램 인증값 오류, 인증키를 다시 입력하세요", MsgBoxStyle.Information, "확인")
+ DialogResult = System.Windows.Forms.DialogResult.Cancel
+ End If
+ Catch ex As Exception
+ MsgBox("인증키 확인 중 오류 발생, 다시 시도하세요")
+ TextBox1.Focus()
+ TextBox1.SelectAll()
+ Return
+ End Try
+
+
+
+
+ End Sub
+
+
+End Class
\ No newline at end of file
diff --git a/DriveInfo/모듈/Pub.vb b/DriveInfo/모듈/Pub.vb
index 81e42e4..eb13189 100644
--- a/DriveInfo/모듈/Pub.vb
+++ b/DriveInfo/모듈/Pub.vb
@@ -31,6 +31,10 @@ Module Pub
Public FTPPassive As Boolean = False
Public FTPUTF8 As Boolean = False
+ Public IsPro As Boolean = False
+ Public Runcnt As UInt16 = 0
+ Public Rundate As Date = Now
+
Public Enum EJobCmdType
copy = 0
move = 1
diff --git a/DriveInfo/모듈/mod_Delete.vb b/DriveInfo/모듈/mod_DeleteM.vb
similarity index 75%
rename from DriveInfo/모듈/mod_Delete.vb
rename to DriveInfo/모듈/mod_DeleteM.vb
index 9d6e1ac..e30faa7 100644
--- a/DriveInfo/모듈/mod_Delete.vb
+++ b/DriveInfo/모듈/mod_DeleteM.vb
@@ -2,7 +2,7 @@
Imports System.Threading
Imports System.Data
-Module Mod_Delete
+Module Mod_DeleteM
'Public Sub DeleteFile()
' DeleteFileFromList()
'End Sub
@@ -75,6 +75,10 @@ Module Mod_Delete
Dim index As Integer = 0
Dim endcnt As Integer = MDiMain.DataSet1.SrcList.Rows.Count - 1
+ '//ftp 여부 확인
+ Dim isFTP As Boolean = False
+ If GetWorkDIr.StartsWith("ftp:/") Then isFTP = True
+
If MDiMain.DataSet1.SrcList Is Nothing Then
MsgBox("원본목록이 존재하지않습니다." & vbCrLf & "진행할 수 없습니다", MsgBoxStyle.Information, "확인")
@@ -130,54 +134,6 @@ Module Mod_Delete
End Sub
- Public Sub DeleteFileR(winhide As Boolean) '//실제로 파일을 삭제합니다. 삭제시 성공여부를 기록합니다
- Dim FI As FileInfo
- Dim Err As Boolean = False
-
- MDiMain.MSG("파일삭제 준비중")
-
- Dim index As Integer = 0
- Dim endcnt As Integer = MDiMain.DataSet1.WorkList.Rows.Count - 1
-
-
- If MDiMain.DataSet1.WorkList Is Nothing Then
- MsgBox("작업파일목록이 존재하지않습니다." & vbCrLf & "진행할 수 없습니다", MsgBoxStyle.Information, "확인")
- Return
- End If
-
- For Each Dr As ireaDataSet.WorkListRow In MDiMain.DataSet1.WorkList.Rows
- index += 1
- MDiMain.ShowCnt1(index, endcnt, "파일삭제")
- Application.DoEvents()
-
- If Dr.오류 <> "" Then
- Errlog("선오류감지되어서 넘어갑니다(" & Dr.오류 & ")")
- Else
-
- Try
- FI = New FileInfo(CStr(Dr.원본경로 & "\" & Dr.원본파일명).Replace("\\", "\"))
- Check_Backup(FI, BakTag)
- If FI.Exists = False Then Dr.오류 = "파일없음"
- Try
- FI.Delete()
- Dr.성공 = "O"
- Dr.오류 = ""
- Catch ex As Exception
- Err = True
- Dr.성공 = "X"
- Dr.오류 = ex.Message.ToString()
- End Try
- Catch ex As Exception
- Err = True
- Dr.성공 = "X"
- Dr.오류 = ex.Message
- Errlog("FI = New FileInfo(CStr(Dr.원본경로 &)" & ex.Message.ToString)
- End Try
-
- End If
- Next
- MDiMain.MSG("파일 [삭제] 완료" & IIf(Err, "(일부파일에 오류가 발생하였습니다", ""))
- End Sub
End Module
diff --git a/DriveInfo/모듈/mod_DeleteR.vb b/DriveInfo/모듈/mod_DeleteR.vb
new file mode 100644
index 0000000..ab77726
--- /dev/null
+++ b/DriveInfo/모듈/mod_DeleteR.vb
@@ -0,0 +1,83 @@
+Imports System.IO
+Imports System.Threading
+Imports System.Data
+
+Module Mod_DeleteR
+
+
+ Public Sub DeleteFileR(winhide As Boolean) '//실제로 파일을 삭제합니다. 삭제시 성공여부를 기록합니다
+ Dim FI As FileInfo
+ Dim Err As Boolean = False
+
+ MDiMain.MSG("파일삭제 준비중")
+
+ Dim index As Integer = 0
+ Dim endcnt As Integer = MDiMain.DataSet1.WorkList.Rows.Count - 1
+
+ '//ftp 여부 확인
+ Dim isFTP As Boolean = False
+ If GetWorkDIr.StartsWith("ftp:/") Then isFTP = True
+
+
+ If MDiMain.DataSet1.WorkList Is Nothing Then
+ MsgBox("작업파일목록이 존재하지않습니다." & vbCrLf & "진행할 수 없습니다", MsgBoxStyle.Information, "확인")
+ Return
+ End If
+
+ For Each Dr As ireaDataSet.WorkListRow In MDiMain.DataSet1.WorkList.Rows
+ index += 1
+ MDiMain.ShowCnt1(index, endcnt, "파일삭제")
+ Application.DoEvents()
+
+ If Dr.오류 <> "" Then
+ Errlog("선오류감지되어서 넘어갑니다(" & Dr.오류 & ")")
+ Else
+ If isFTP Then
+ Dim SrcFIp As String = CStr(Dr.원본경로 & "\" & Dr.원본파일명).Replace("\\", "\").Replace("\", "/")
+ Try
+ '//실제 파일의 삭제작업을 진행한다
+ Dim result As Boolean = FTP_0.FtpDelete(SrcFIp)
+ If result Then
+ Dr.성공 = "O"
+ Dr.오류 = ""
+ Else
+ Dr.성공 = "X"
+ Dr.오류 = "FTP서버로부터의 삭제 실패 메세지 반환(파일이 없는 경우에도 이메세지가 반환 됨)"
+ End If
+ Catch ex As Exception
+ Err = True
+ Dr.성공 = "X"
+ Dr.오류 = ex.Message
+ Errlog("FTP Delete File " + SrcFIp & ex.Message.ToString)
+ End Try
+
+ Else
+ Try
+ FI = New FileInfo(CStr(Dr.원본경로 & "\" & Dr.원본파일명).Replace("\\", "\"))
+ Check_Backup(FI, BakTag)
+ If FI.Exists = False Then Dr.오류 = "파일없음"
+ Try
+ FI.Delete()
+ Dr.성공 = "O"
+ Dr.오류 = ""
+ Catch ex As Exception
+ Err = True
+ Dr.성공 = "X"
+ Dr.오류 = ex.Message.ToString()
+ End Try
+ Catch ex As Exception
+ Err = True
+ Dr.성공 = "X"
+ Dr.오류 = ex.Message
+ Errlog("FI = New FileInfo(CStr(Dr.원본경로 &)" & ex.Message.ToString)
+ End Try
+ End If
+
+
+ End If
+ Next
+ MDiMain.MSG("파일 [삭제] 완료" & IIf(Err, "(일부파일에 오류가 발생하였습니다", ""))
+ End Sub
+
+
+End Module