110,535
社区成员
发帖
与我相关
我的任务
分享
static void Main(string[] args)
{
var url = "http://localhost:8000";
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
Process.Start("xdg-open", url).Dispose();
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
Process.Start("open", url).Dispose();
}
else
{
Process.Start(new ProcessStartInfo(url) { UseShellExecute = true}).Dispose();
}
}