不是执行bat
是把批处理命令直接写到代码中
是把批处理命令直接写到代码中
解决方案 »
- 100分全送 installshield 脚本语言 修改web.config文件 中文乱码 编码格式
- 请教关于gridview的问题
- c# 中添加系统中应用程序 快捷方式?????
- 操作excel的问题
- 求助!ListBox的DrawItem问题!
- 请问各位大侠要使richTextBox特定一段文字变色有几种方法?
- 在C#中, 想以SYSDBA的方式连接ORACLE数据库, 连接字符串应该怎么写?
- 求助 多线程相关 同时完成多个步骤的程序 异步 多线程
- C# TreeView DataBingings 如何使用
- 请问怎么在pictureBox中加scrollbar呢?
- 模拟按键事件输入文本框
- 关于XML文档的问题
直接在代码中写 完全不要出现bat这个东西
p.StartInfo.FileName = "cmd";
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.Start();
StreamWriter sw = p.StandardInput;
sw.WriteLine("regsvr32 /s TMNC_OCX.ocx");
sw.Close();
return true;
要返回值吗???
Process p = new Process();
p.StartInfo.FileName = "cmd";
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.Start();
StreamWriter sw = p.StandardInput;
sw.WriteLine("regsvr32 /s TMNC_OCX.ocx");
sw.WriteLine("第二句命令");
sw.Close();
return true;