随笔分类 -  c#调用CMD窗口

整体读入cmd结果,而不是分行读入,效率极高
摘要:public static long GetDirectorySize(string path) { long res = 0; System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo.FileName 阅读全文

posted @ 2019-03-02 14:53 mol1995 阅读(284) 评论(0) 推荐(0)

用Dos黑窗口运行Cmd命令
摘要:public class BlackWindow { private static BlackWindow _instance; public static BlackWindow Instance { get { if (_instance == null) _instance = new Bla 阅读全文

posted @ 2018-05-14 13:45 mol1995 阅读(936) 评论(0) 推荐(0)

2013-1-17 打开/关闭默认共享的命令
摘要:net share d$=d:\ 可打开d$的默认共享,但权限只有只读 net share d$=d:\ /grant:administrator,full 将d$的所有权限赋予administrator用户。 net share d$ /delete 删除此共享. //一般访问 net use \ 阅读全文

posted @ 2016-10-15 19:13 mol1995 阅读(520) 评论(0) 推荐(0)

2011-12-14 调用cmd并获得输入输出+网络访问
摘要:System.Diagnostics.Process pro = new System.Diagnostics.Process(); pro.StartInfo.FileName = "cmd.exe"; pro.StartInfo.UseShellExecute = false; pro.Star 阅读全文

posted @ 2016-10-15 18:44 mol1995 阅读(205) 评论(0) 推荐(0)

2016.1.23 通过cmd在程序中执行sql脚本
摘要:System.Diagnostics.Process pro = new System.Diagnostics.Process(); pro.StartInfo.FileName = "cmd.exe"; pro.StartInfo.UseShellExecute = false; pro.Star 阅读全文

posted @ 2016-10-15 17:51 mol1995 阅读(234) 评论(0) 推荐(0)

2014.10.1 Cmd更改系统时间
摘要:Process p = new Process(); //Process类有一个StartInfo属性 //设定程序名 p.StartInfo.FileName = "cmd.exe"; ////设定程式执行参数 “/C”表示执行完命令后马上退出 p.StartInfo.Arguments = st 阅读全文

posted @ 2016-10-15 17:01 mol1995 阅读(405) 评论(0) 推荐(0)

导航