패키지 업데이트 분리 작업
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
@@ -13,7 +14,7 @@ namespace Mitria_Minecraft_Launcher
|
||||
bool error = false;
|
||||
|
||||
DirectoryInfo directoryInfo = new DirectoryInfo(location);
|
||||
|
||||
|
||||
foreach (var fi in directoryInfo.EnumerateFiles())
|
||||
{
|
||||
try
|
||||
@@ -55,6 +56,38 @@ namespace Mitria_Minecraft_Launcher
|
||||
return error;
|
||||
}
|
||||
|
||||
static void DeleteFile(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
File.SetAttributes(filePath, FileAttributes.Normal); // 읽기 전용 제거
|
||||
File.Delete(filePath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("파일 삭제 실패: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
static void DeleteDirectory(string dirPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 하위 파일 속성 변경 및 삭제
|
||||
foreach (string file in Directory.GetFiles(dirPath, "*", SearchOption.AllDirectories))
|
||||
{
|
||||
File.SetAttributes(file, FileAttributes.Normal);
|
||||
}
|
||||
|
||||
// 디렉터리 삭제 (재귀적)
|
||||
Directory.Delete(dirPath, true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("디렉터리 삭제 실패: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public static string ApplyExcuteCommand(ExcuteArgument excuteArgument)
|
||||
{
|
||||
string command = excuteArgument.Argument;
|
||||
@@ -79,12 +112,12 @@ namespace Mitria_Minecraft_Launcher
|
||||
|
||||
return command;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static bool IsDefault<T>(ref this T data) where T : struct
|
||||
{
|
||||
return default(T).Equals(data);
|
||||
}
|
||||
|
||||
public static string UnitSeparator(this long value)
|
||||
{
|
||||
return string.Format("{0:#,0}", (object)value);
|
||||
@@ -94,6 +127,7 @@ namespace Mitria_Minecraft_Launcher
|
||||
{
|
||||
return string.Format("{0:#,0}", (object)value);
|
||||
}
|
||||
|
||||
public static string GetFileHashCode(this FileInfo file)
|
||||
{
|
||||
using (MD5 md5 = MD5.Create())
|
||||
|
Reference in New Issue
Block a user