摘要:
<script type="text/javascript"> function Run(strPath) { try { var objShell = new ActiveXObject("wscript.shell"); objShell.Run(strPath); objShell = null; } catch (e) { alert('找不到文件"'+strPat... 阅读全文
随笔档案-2010年11月
c#调用EXE文件方法
2010-11-19 09:53 by zhaoyang, 961 阅读, 收藏, 编辑
摘要:
static void ExcuteProcess(string exe, string arg, DataReceivedEventHandler output){using (var p = new Process()){p.StartInfo.FileName = exe;p.StartInfo.Arguments = arg;p.StartInfo.UseShellExecute = fa... 阅读全文
记录程序运行时间
2010-11-10 11:50 by zhaoyang, 510 阅读, 收藏, 编辑
摘要:
一、引入所需要的命名空间using System.Diagnostics;二、定义一个全局变量private Stopwatch stw = new Stopwatch();其中Stopwatch说明如下:三、在窗体载入时执行stw.Start代码如下private void Form1_Load(object sender, EventArgs e) { stw.Start(); ... 阅读全文