public Task OpenUriInBrowserAsync(string UriString)
{
return Task.Run(() =>
{
string myPath = UriString;
try
{
var configBrowserPath = this._cfgLocal.BrowserPath;
if (!string.IsNullOrEmpty(configBrowserPath))
{
if (configBrowserPath.StartsWith("\"", StringComparison.Ordinal) && configBrowserPath.Length > 2 && configBrowserPath.IndexOf("\"", 2, StringComparison.Ordinal) > -1)
{
int sep = configBrowserPath.IndexOf("\"", 2, StringComparison.Ordinal);
string browserPath = configBrowserPath.Substring(1, sep - 1);
string arg = "";
if (sep < configBrowserPath.Length - 1)
{
arg = configBrowserPath.Substring(sep + 1);
}
myPath = arg + " " + myPath;
System.Diagnostics.Process.Start(browserPath, myPath);
}
else
{
System.Diagnostics.Process.Start(configBrowserPath, myPath);
}
}
else
{
System.Diagnostics.Process.Start(myPath);
}
}
catch (Exception)
{
//MessageBox.Show("ブラウザの起動に失敗、またはタイムアウトしました。" + ex.ToString());
}
});
}