在system.diagnostics.process.start()中需要帮助才能将输出读入sql server [英] need help in system.diagnostics.process.start() to read the output into the sql server

查看:66
本文介绍了在system.diagnostics.process.start()中需要帮助才能将输出读入sql server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个字符串,它将下载我给它的一个文件到system.diagnostics.process.start.It正常工作。获取process.start的输出并将其保存在sql server

解决方案

尝试:

处理p =  new 过程(); 
p.StartInfo.FileName = @ MyApp.exe;
p.StartInfo.Arguments = 你好;
p.StartInfo.RedirectStandardOutput = true ;
p.StartInfo.UseShellExecute = false ;
p.Start();
p.WaitForExit();
string s = p.StandardOutput.ReadToEnd();

然后你可以用通常的方式将字符串保存在s中


i have a string it will download the a file that i gave it to system.diagnostics.process.start.It is working fine.how to get the output of the process.start and save it in the sql server

解决方案

Try:

Process p = new Process();
p.StartInfo.FileName = @"MyApp.exe";
p.StartInfo.Arguments = "hello there";
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.UseShellExecute = false;
p.Start();
p.WaitForExit();
string s = p.StandardOutput.ReadToEnd();

You can then save the string in "s" in the usual way.


这篇关于在system.diagnostics.process.start()中需要帮助才能将输出读入sql server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆