diff --git a/VPet.ModMaker/Utils/NativeUtils.cs b/VPet.ModMaker/Utils/NativeUtils.cs
index 1439883..a811231 100644
--- a/VPet.ModMaker/Utils/NativeUtils.cs
+++ b/VPet.ModMaker/Utils/NativeUtils.cs
@@ -82,4 +82,28 @@ public static class NativeUtils
}
return bitmapImage;
}
+
+ ///
+ /// 打开文件
+ ///
+ /// 文件路径
+ public static void OpenLink(string filePath)
+ {
+ System
+ .Diagnostics.Process.Start(
+ new System.Diagnostics.ProcessStartInfo(filePath) { UseShellExecute = true }
+ )
+ ?.Close();
+ }
+
+ ///
+ /// 从资源管理器打开文件
+ ///
+ /// 文件路径
+ public static void OpenFileInExplorer(string filePath)
+ {
+ System
+ .Diagnostics.Process.Start("Explorer", $"/select,{Path.GetFullPath(filePath)}")
+ ?.Close();
+ }
}
diff --git a/VPet.ModMaker/Views/ModMakerWindow.xaml.cs b/VPet.ModMaker/Views/ModMakerWindow.xaml.cs
index 3654003..aa00111 100644
--- a/VPet.ModMaker/Views/ModMakerWindow.xaml.cs
+++ b/VPet.ModMaker/Views/ModMakerWindow.xaml.cs
@@ -72,6 +72,6 @@ public partial class ModMakerWindow : WindowX
private void Hyperlink_Click(object? sender, RoutedEventArgs e)
{
- Process.Start(new ProcessStartInfo("https://github.com/LorisYounger/VPet.ModMaker/wiki"));
+ NativeUtils.OpenLink("https://github.com/LorisYounger/VPet.ModMaker/wiki");
}
}