asp.net 運(yùn)行.bat文件的方法具體實(shí)現(xiàn)
來源:易賢網(wǎng) 閱讀:1133 次 日期:2014-10-08 11:14:20
溫馨提示:易賢網(wǎng)小編為您整理了“asp.net 運(yùn)行.bat文件的方法具體實(shí)現(xiàn)”,方便廣大網(wǎng)友查閱!

// create the processinfo object

system.diagnostics.processstartinfo psi = new system.diagnostics.processstartinfo(cmd.exe);

psi.useshellexecute = false;

psi.redirectstandardoutput = true;

//psi.redirectstandardinput = true;

psi.redirectstandarderror = true;

psi.arguments = /k c:\temp\test.bat;

psi.workingdirectory = c:\temp\;

// start the process

system.diagnostics.process proc = system.diagnostics.process.start(psi);

// attach the output for reading

system.io.streamreader sout = proc.standardoutput;

proc.close();

// read the sout to a string.

string results = sout.readtoend().trim();

sout.close();

// write out the results.

string fmtstdout = {0};

this.response.write(string.format(fmtstdout, results.replace(system.environment.newline,

)));

更多信息請查看IT技術(shù)專欄

更多信息請查看網(wǎng)絡(luò)編程
易賢網(wǎng)手機(jī)網(wǎng)站地址:asp.net 運(yùn)行.bat文件的方法具體實(shí)現(xiàn)
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機(jī)站點(diǎn)

版權(quán)所有:易賢網(wǎng)