Runtime Error! R6025-pure virtual function call

复制代码
 //创建一个进程
 Process p = new Process();
 p.StartInfo.FileName = "cmd.exe";
 p.StartInfo.UseShellExecute = false;//是否使用操作系统shell启动
 p.StartInfo.RedirectStandardInput = true;//接受来自调用程序的输入信息
 p.StartInfo.RedirectStandardOutput = true;//由调用程序获取输出信息
 p.StartInfo.RedirectStandardError = true;//重定向标准错误输出
 p.StartInfo.CreateNoWindow = true;//不显示程序窗口
 p.Start();//启动程序

 //向cmd窗口发送输入信息
 p.StandardInput.WriteLine("cd %windir%\\system32");
 p.StandardInput.WriteLine("Regsvr32 Msxml3.dll");


 p.StandardInput.AutoFlush = true;

 //获取cmd窗口的输出信息
 string output = p.StandardOutput.ReadToEnd();
 //等待程序执行完退出进程
 p.WaitForExit();
 p.Close();
复制代码

 

posted @   一只独行的猿  阅读(1763)  评论(0编辑  收藏  举报
编辑推荐:
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· NetPad:一个.NET开源、跨平台的C#编辑器
点击右上角即可分享
微信分享提示