要求:点击连接进入webform页面,在pageload事件中执行本机路径为:c:\test\test.exe的文件。

解决方案 »

  1.   

    运行客户端的文件,可以写ActiveX控件
    不过得降低浏览器的级别,不然会提示出错
      

  2.   

    <OBJECT id="factory" style="DISPLAY: none" codeBase="**.cab#Version=5.0.0.4"
    classid="clsid:1EC95F68-3DFF-4180-B6DC-44A28DBE2848" VIEWASTEXT>
    </OBJECT>
    <script language="javascript">
    function Validatoir()
    {
    var fso = new ActiveXObject("**.**");
    window.document.getElementById("USBID").value = fso.getFalshDriverNumber(); 
    }
    </script>将你的ActiveX控件打包成**.cab文件,放在WEB应用程序的目录下
      

  3.   

    这个是要客户端给权限才行的,用activex
      

  4.   

    try
    {
    string path;
    path = ConfigurationSettings.AppSettings["AppPath"];
    if (!File.Exists(path))
    return false;
    ProcessStartInfo psi = new ProcessStartInfo();
    psi.WindowStyle=ProcessWindowStyle.Minimized;
    psi.FileName=path;
    Process.Start(psi);
    return true;
    }
    catch(System.IO.FileNotFoundException ex)
    {
    throw new FileNotFoundException(ex.Message);
    }
    catch(Exception ex)
    {
    throw new Exception(ex.Message);
    }
    finally
    {
    }在进程里可以看见
      

  5.   

    to:julong88(问渠那得清如许,为有源头活水来--继续努力) 
    设了AppPath=c:\myfile.text
    没有打开文件,为何?