#region Winform開啟網址url
private void BtnLogo_Click(object sender, EventArgs e)
{
OpenUrl("https://www.apmtech.com.tw/");
}
/// <summary>
/// C# Winform開啟網址url
/// </summary>
/// <param name="url">要開啟的網頁網址</param>
public void OpenUrl(string url)
{
try
{
Process pro = new Process();
//pro.StartInfo.FileName = "iexplore.exe";
//pro.StartInfo.FileName = "MicrosoftEdge.exe";
pro.StartInfo.FileName = "chrome.exe";
pro.StartInfo.Arguments = url;
pro.Start();
}
catch (Exception)
{
this.rtfMsg.Text = "Hi:請確認chrome.exe正常" + " @" + DateTime.Now.ToString();
}
}
#endregion
沒有留言:
張貼留言