February 18 2015

c#调用exe传参数

1、Process p1 = Process.Start(@”C:\WindowsFormsApplication1.exe”, “xlj xiaowei”);
2、function runExe(command) {
window.oldOnError = window.onerror;
window._command = command;
window.onerror = function(err) {
if (err.indexOf(‘Automation’) != -1) {
alert(‘执行’ + window._command + ‘过程中,\n\r\n\r无法找到路径或被您禁止运行本地文件!’);
return true;
}
else return false;
};
var wsh = new ActiveXObject(‘WScript.Shell’);
if (wsh) wsh.Run(command+” xlj bobo”);
window.onerror = window.oldOnError;
}

3、 /// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] arg)//接收参数
{
}



Copyright 2019. All rights reserved.

Posted 2015年2月18日 by ucjmh in category "c#

Leave a Reply

Your email address will not be published. Required fields are marked *