This repository has been archived on 2026-08-05. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
biss f61e298871
Build and Release / Publish Windows, Linux and macOS (push) Successful in 3m7s
Migrate desktop app to Avalonia and publish cross-platform releases
2026-07-19 08:51:41 +08:00

32 lines
719 B
C#

using System.Diagnostics;
namespace kcsj.Services;
public static class PlatformLauncher
{
public static void OpenFolder(string folderPath)
{
ProcessStartInfo startInfo;
if (OperatingSystem.IsWindows())
{
startInfo = new ProcessStartInfo
{
FileName = folderPath,
UseShellExecute = true
};
}
else
{
startInfo = new ProcessStartInfo
{
FileName = OperatingSystem.IsMacOS() ? "open" : "xdg-open",
UseShellExecute = false
};
startInfo.ArgumentList.Add(folderPath);
}
Process.Start(startInfo);
}
}