zoukankan      html  css  js  c++  java
  • C#调用浏览器(默认和非默认浏览器)

    调用 IE:

    System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
    myProcess.StartInfo.FileName = "iexplore.exe";
    myProcess.StartInfo.Arguments = " http://www.net0and1.com/";
    myProcess.Start();

    调用默认浏览器:
        string target= "http://www.net0and1.com";
        //Use no more than one assignment when you test this code.
        //string target = "ftp://ftp.microsoft.com";
        //string target = "C:\\Program Files\\Microsoft Visual Studio\\INSTALL.HTM";

        try
            {
             System.Diagnostics.Process.Start(target);
            }
        catch
            (
             System.ComponentModel.Win32Exception noBrowser)
            {
             if (noBrowser.ErrorCode==-2147467259)
              MessageBox.Show(noBrowser.Message);
            }
        catch (System.Exception other)
            {
              MessageBox.Show(other.Message);
            }
  • 相关阅读:
    题解-CF468E Permanent
    CSP2021 游记
    二项式系数相关
    欧拉反演
    欧拉函数
    [快速幂]1
    GMT绘制地形起伏
    华为mate8双击唤醒屏幕
    回家乡了
    CSP-S2021
  • 原文地址:https://www.cnblogs.com/linmilove/p/1500990.html
Copyright © 2011-2022 走看看