程序功能主要是:读入已知文件,调用外部程序pfnt.exe进行相关的计算,然后把程序计算的结果以文档形式进行输出。但在运行到info.start()时,出现“系统找不到指定的文件”这个错误,请大虾指教!!! - P- n o) u0 T( a c: T6 Z5 I- e, Y$ [& r# C2 M7 h0 q
using System;* Y% s8 {! M; ^6 b3 v
using System.Collections.Generic;2 U4 K0 B! e. [) ?' p3 v
using System.Text;7 _1 x( ~# `, j0 u2 b7 m4 h
using System.Diagnostics;" G1 B) e8 c- A7 d8 ^! w" G
using System.IO;* f6 P/ e% Z# n3 n) y' t/ A
* m* z- `$ h8 M! |3 B$ x8 ?; wnamespace ConsoleApplication28 H* d V- T/ F- I{ ; e+ O: z. j6 Q' \$ [ class Program 5 ^1 @, j: C! o {& m6 P1 \, j6 h* @+ y; k* j( O3 g
static void Main(string[] args)- P6 m M3 E0 l0 Z# c
{5 N% \8 q$ D. x
Process info = new Process();8 p+ t- p, S. F% f& ?. U y7 ]# Y
info.StartInfo.FileName = "pfnt.exe"; $ Q- f6 e% V7 L9 \# B info.StartInfo.Arguments = @"E:\广东电网充裕度评估系统\BPA数据\2008年底大(正常潮流).dat";//原始数据文件路径 . p& M: [ k. i, U! i info.StartInfo.WorkingDirectory = @"C:\psap32\BIN";//pfnt。exe程序路径 ' M/ I c3 [2 f7 z0 } info.StartInfo.UseShellExecute = false;& o+ Y1 k: ]/ _+ X" R" G
info.StartInfo.RedirectStandardInput = true;" q( H4 W8 S: H: b
info.StartInfo.RedirectStandardOutput = true; 2 Z7 L& R3 N% X! I6 \/ p" p info.Start();/ W9 h9 o9 s! _7 V1 M" j
StreamReader sr = info.StandardOutput;. ~8 y0 [- O' a- R, l
StreamWriter sw = new StreamWriter(@"E:\广东电网充裕度评估系统\童—潮流计算程序\powerflow.txt");//生成文档存放位置3 `9 @3 c/ O Q4 h$ n3 r
sw.Write(sr.ReadToEnd());4 O- m% @5 U4 S/ e
sw.Close(); 4 R8 }: q3 ^& P0 B6 a } 3 X% v+ S- Y* {6 g. \+ }0 O/ L } . ?8 g7 \1 I8 U4 Z# E5 ~! t9 t0 e! u}