This commit is contained in:
Hakoyu 2024-03-29 23:49:57 +08:00
parent 0fe086bd8b
commit 8d2baeb77f
2 changed files with 25 additions and 1 deletions

View File

@ -82,4 +82,28 @@ public static class NativeUtils
}
return bitmapImage;
}
/// <summary>
/// 打开文件
/// </summary>
/// <param name="filePath">文件路径</param>
public static void OpenLink(string filePath)
{
System
.Diagnostics.Process.Start(
new System.Diagnostics.ProcessStartInfo(filePath) { UseShellExecute = true }
)
?.Close();
}
/// <summary>
/// 从资源管理器打开文件
/// </summary>
/// <param name="filePath">文件路径</param>
public static void OpenFileInExplorer(string filePath)
{
System
.Diagnostics.Process.Start("Explorer", $"/select,{Path.GetFullPath(filePath)}")
?.Close();
}
}

View File

@ -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");
}
}