惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
T
Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
Intezer
C
Cyber Attacks, Cyber Crime and Cyber Security
The Register - Security
The Register - Security
量子位
Security Latest
Security Latest
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
MyScale Blog
MyScale Blog
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Spread Privacy
Spread Privacy
Jina AI
Jina AI
博客园 - 【当耐特】
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
SecWiki News
SecWiki News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
宝玉的分享
宝玉的分享
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
有赞技术团队
有赞技术团队
T
Tor Project blog
H
Hacker News: Front Page
A
Arctic Wolf
NISL@THU
NISL@THU
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
V
V2EX
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
I
InfoQ
D
Docker
L
LINUX DO - 最新话题
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42

博客园 - J-Pei

entity framework ConnectionString include password Microsoft Visual Studio无法启动程序进行调试的解决方法 深入理解Javascript闭包(closure) 安装SQL Server 2005过程出现错误:“SQL Server 服务无法启动”的解决办法 动态修改div的xy值 asp.net mvc 与jquery应用总结 Ajax 选项 这才是真正的JQuery.ajax传递中文参数的解决方法 ASP.NET MVC生命周期介绍(转) ASP.NET页生命周期介绍:阶段,事件及其他(转) JQuery 实现网页的快捷键操作 IE8下json.js 中文编码问题 Meet Chirpy sybase性能调优 Entity FrameWork 4.1 RC 生成的sql语法性能存在问题 ADO.NET Entity FrameWork 4.1 RC 发布 asp.net MVC EF dynamic query 服务器返回json SQL SERVER 2008 MASTER数据库损坏修复
通过Process调用桌面程序
J-Pei · 2012-02-02 · via 博客园 - J-Pei

通过Process调用桌面程序

View Code

 1 private void Form1_Load(object sender, EventArgs e)
 2         {
 3             string userid = "admin";
 4             string password = "00";
 5             string[] cmd = new string[] { @"cd E:\Project\DotNet\bin\Debug""PhotoMan.exe $StartFromEIP$ " + userid + " " + assword };
 6 
 7             Process p = new Process();
 8             p.StartInfo.FileName = "cmd.exe";
 9             p.StartInfo.UseShellExecute = false;
10             p.StartInfo.RedirectStandardInput = true;
11             p.StartInfo.RedirectStandardOutput = true;
12             p.StartInfo.RedirectStandardError = true;
13             p.StartInfo.CreateNoWindow = true;
14             p.Start();
15             p.StandardInput.AutoFlush = true;
16             for (int i = 0; i < cmd.Length; i++)
17             {
18                 p.StandardInput.WriteLine(cmd[i].ToString());
19             }
20             p.StandardInput.WriteLine("exit");
21             string strRst = p.StandardOutput.ReadToEnd();
22             p.WaitForExit();
23             p.Close();
24             Form1_FormClosed(nullnull);
25 
26         }
27 
28         private void Form1_FormClosed(object sender, FormClosedEventArgs e)
29         {
30             Application.Exit();
31         }