在webform中可否执行本机的exe文件? 要求:点击连接进入webform页面,在pageload事件中执行本机路径为:c:\test\test.exe的文件。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 运行客户端的文件,可以写ActiveX控件不过得降低浏览器的级别,不然会提示出错 <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应用程序的目录下 这个是要客户端给权限才行的,用activex 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 { }在进程里可以看见 to:julong88(问渠那得清如许,为有源头活水来--继续努力) 设了AppPath=c:\myfile.text没有打开文件,为何? 用DataGridView控件如何实现在非编辑情况下字段名为中文? 回车键键事件是怎么做的? 最完整的ClickOnce应用教程(多图) 如何列表局域网中所有SQL Server的服务器名称? VS2005下,PrintDocument为何只打印B5大小的页面,打不出A4? C#高手见,DATALIST关于类似DATAGRID的翻页编写问题 计算机中编码存储的汉字有多少个 关于泛型中的T的疑问 欢迎讨论,大家在作OO设计时,如何表示对象集合的? 有人在沈阳东宇软件呆过吗? 问个Bitmap的SetPixel的问题 如何在WinForm中的DataGrid中加入单选列?郁闷55555
不过得降低浏览器的级别,不然会提示出错
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应用程序的目录下
{
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
{
}在进程里可以看见
设了AppPath=c:\myfile.text
没有打开文件,为何?