/// <summary> /// 打开文件所在的文件夹 /// </summary> public static void OpenFileDialog(string stringPath) { System.Diagnostics.Process.Start("explorer", "/select," + stringPath); } /// <summary> /// 打开指定网页 /// </summary> public static void OpenNetPage(string url) { System.Diagnostics.Process.Start("iexplore", url);//System.Diagnostics.Process.Start(url);默认浏览器打开 }
调用
OpenFileDialog(@"C:\Program Files"); OpenNetPage(@"http://www.baidu.com");