메뉴얼 파일 압축 해제 관련 기능 추가

This commit is contained in:
2025-12-11 00:50:51 +09:00
parent 132ddc6495
commit 1fd7c25c8d
11 changed files with 815 additions and 385 deletions

View File

@@ -22,6 +22,7 @@ Partial Class Frm_WebManual
'코드 편집기에서는 수정하지 마세요.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Frm_WebManual))
Me.WebView21 = New Microsoft.Web.WebView2.WinForms.WebView2()
CType(Me.WebView21, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
@@ -44,6 +45,7 @@ Partial Class Frm_WebManual
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1350, 700)
Me.Controls.Add(Me.WebView21)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Name = "Frm_WebManual"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "사용자 매뉴얼"

View File

@@ -117,4 +117,24 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAAAIABsAwAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAzNJ
REFUeJxVk99PHHUUxT8zO7OzC7vsLrsgQtYSaySxoUWk9oFSY1Otxvhg/J0YTXnwwUSJiX+AL/wDRquJ
0fbBVPvSaGJsQ7WKlMYallBMoA0oQmAJS9lld2WYme/3O1+zpjX0Pt6ce+7JPfcYWmv21sjk8BDwLnAY
aAMsoApc16E+/dHQmUt78cZdgpHJ4QbwLPDS8/kTTibeRs1txg1AKg/JBj+tX5RKqstSqle+ePabf/4n
GJkctoGfB3IHBp/OP0nNc/AJWKwZRLXDlhuiZUAcl3V/gqni1KwU8ti5l7+tmneUnO3PPjx4tHOAsgoQ
poGUJrsyikuUsu9Q8uKsVm0eSDzOQEfPwcAXX/+n4L2rp44CVz449JY9K3fwDGhWCXCzrO3Y+MLg5kod
woD7Osq055Z4LNbFh99/qqSQLzYUvH+y84hd8naoI1FhjlaVZu62QaUON5brBE4Fa/8fVLIF5lWRuY0V
Xu09Hgl88U7jcIfzLV3MuEU2YyaPRPYTIlkuBXjeLqkOTa11jMVwG3xNWjosbPqc6O5H+LK3QZBtsppZ
douUfJdk04NsB0kqlZBUm0d7xmVT9VHzb+DoOvXbW5S3m0jEk4hApi2ttWFoCPwamjyWrbj4m8CIJ1hf
lJi6hc62XZL1IWprAo8pRLAEWiOlNCwlw3ItqHVlI2mSsUOsblp4wiYac4i1x/nzry2839MQeqTabdLN
XaQiJSo7VZQMq6YUcvrv8goPNeUpliYJ7TWiER/huQhhEU1kcFpjWDET21BEgk0678+xVFxquDhvikB+
fOHmuNyXaMNy16huXSOT8bGkj21oHDOCFQRk8quk2n/F3L1FX76X0z9eaLzw5+aXz50fC3zxw9jcOE90
9ZGKNJNJhKSiipaoR9L2SccFrdYEZnGZ/gM9XC6MN7aPF0ZnzjVcQPjijV8WZq76u8HBk48e41bJIlLV
SKOOCE1IKPL7uunp7ebK9DUuzV5fAF6/J0zPfHI8KYU8L4V66s3BUxaqA62bMEyDXKrGRnmaz8a+U8AE
8FphdGbjHoK7NTh65AUl1dtKhb2hCjN32o04zwNnCqMzX+0d+BfEDZRfNsnANgAAAABJRU5ErkJggg==
</value>
</data>
</root>

View File

@@ -0,0 +1,92 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Frm_WwwrootExtract
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
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
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.lblStatus = New System.Windows.Forms.Label()
Me.progressBar = New System.Windows.Forms.ProgressBar()
Me.lblPercentage = New System.Windows.Forms.Label()
Me.lblTitle = New System.Windows.Forms.Label()
Me.SuspendLayout()
'
'lblStatus
'
Me.lblStatus.AutoSize = True
Me.lblStatus.Location = New System.Drawing.Point(30, 90)
Me.lblStatus.Name = "lblStatus"
Me.lblStatus.Size = New System.Drawing.Size(113, 12)
Me.lblStatus.TabIndex = 0
Me.lblStatus.Text = "압축 해제 준비 중..."
'
'progressBar
'
Me.progressBar.Location = New System.Drawing.Point(30, 110)
Me.progressBar.Name = "progressBar"
Me.progressBar.Size = New System.Drawing.Size(440, 30)
Me.progressBar.TabIndex = 1
'
'lblPercentage
'
Me.lblPercentage.AutoSize = True
Me.lblPercentage.Font = New System.Drawing.Font("굴림", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(129, Byte))
Me.lblPercentage.Location = New System.Drawing.Point(30, 150)
Me.lblPercentage.Name = "lblPercentage"
Me.lblPercentage.Size = New System.Drawing.Size(23, 12)
Me.lblPercentage.TabIndex = 2
Me.lblPercentage.Text = "0%"
'
'lblTitle
'
Me.lblTitle.AutoSize = True
Me.lblTitle.Font = New System.Drawing.Font("굴림", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(129, Byte))
Me.lblTitle.Location = New System.Drawing.Point(30, 30)
Me.lblTitle.Name = "lblTitle"
Me.lblTitle.Size = New System.Drawing.Size(239, 15)
Me.lblTitle.TabIndex = 3
Me.lblTitle.Text = "매뉴얼 파일 압축 해제 중입니다"
'
'Frm_WwwrootExtract
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(500, 200)
Me.Controls.Add(Me.lblTitle)
Me.Controls.Add(Me.lblPercentage)
Me.Controls.Add(Me.progressBar)
Me.Controls.Add(Me.lblStatus)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "Frm_WwwrootExtract"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "압축 해제 중"
Me.TopMost = True
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents lblStatus As Label
Friend WithEvents progressBar As ProgressBar
Friend WithEvents lblPercentage As Label
Friend WithEvents lblTitle As Label
End Class

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,101 @@
Imports System.IO
Imports System.IO.Compression
Imports System.Threading.Tasks
Public Class Frm_WwwrootExtract
Private Sub Frm_WwwrootExtract_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.Show()
Application.DoEvents()
' 폼이 로드될 때 자동으로 압축 해제 시작
ExtractWwwrootAsync()
End Sub
Private Async Sub ExtractWwwrootAsync()
Try
Dim extractPath As String = Path.Combine(Application.StartupPath, "wwwroot")
Dim zipPath As String = Path.Combine(extractPath, "wwwroot.zip")
' ZIP 파일 존재 여부 확인
If Not File.Exists(zipPath) Then
lblStatus.Text = "wwwroot.zip 파일을 찾을 수 없습니다."
MessageBox.Show("wwwroot.zip 파일이 존재하지 않습니다.", "오류", MessageBoxButtons.OK, MessageBoxIcon.Error)
Me.DialogResult = DialogResult.Cancel
Me.Close()
Return
End If
' 압축 해제 작업을 별도 Task로 실행
Await Task.Run(Sub()
ExtractZipWithProgress(zipPath, extractPath)
End Sub)
' 완료
lblStatus.Text = "압축 해제 완료!"
lblPercentage.Text = "100%"
progressBar.Value = 100
Application.DoEvents()
' 잠시 대기 후 폼 닫기
Await Task.Delay(500)
Me.DialogResult = DialogResult.OK
Me.Close()
Catch ex As Exception
lblStatus.Text = "오류 발생: " & ex.Message
MessageBox.Show("압축 해제 중 오류가 발생했습니다: " & ex.Message, "오류", MessageBoxButtons.OK, MessageBoxIcon.Error)
Me.DialogResult = DialogResult.Cancel
Me.Close()
End Try
End Sub
Private Sub ExtractZipWithProgress(zipPath As String, extractPath As String)
Using archive As ZipArchive = ZipFile.OpenRead(zipPath)
Dim totalEntries As Integer = archive.Entries.Count
Dim currentEntry As Integer = 0
For Each entry As ZipArchiveEntry In archive.Entries
currentEntry += 1
' UI 업데이트 (UI 스레드에서 실행)
Me.Invoke(Sub()
Dim percentage As Integer = CInt((currentEntry / totalEntries) * 100)
progressBar.Value = percentage
lblPercentage.Text = percentage.ToString() & "%"
lblStatus.Text = $"압축 해제 중... ({currentEntry}/{totalEntries}) {entry.Name}"
Application.DoEvents()
End Sub)
' 전체 경로 생성
Dim destinationPath As String = Path.Combine(extractPath, entry.FullName)
' 디렉토리 항목인 경우
If entry.FullName.EndsWith("/") OrElse entry.FullName.EndsWith("\") Then
Directory.CreateDirectory(destinationPath)
Continue For
End If
' 파일의 디렉토리가 없으면 생성
Dim directoryPath As String = Path.GetDirectoryName(destinationPath)
If Not Directory.Exists(directoryPath) Then
Directory.CreateDirectory(directoryPath)
End If
' 파일 추출
entry.ExtractToFile(destinationPath, True)
Next
End Using
End Sub
Private Sub Frm_WwwrootExtract_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
' 압축 해제가 진행 중일 때는 폼을 닫을 수 없도록 설정 (사용자가 X 버튼을 누른 경우)
If e.CloseReason = CloseReason.UserClosing AndAlso progressBar.Value < 100 Then
e.Cancel = True
MessageBox.Show("압축 해제가 진행 중입니다. 잠시만 기다려 주세요.", "알림", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
End Class