急啊,人命关天啊,请各位高手不吝赐教啊。CL.EXE的调用
public static String runProcess(String command, String workingPath)
{
throws IOException;
{
String result = "";
Runtime r = null;
Process p = null;
//command="D:/vc2008/bin/cl";
DataInputStream dis = null;
try
{
r = Runtime.getRuntime();
p = r.exec(command, null, new File(workingPath));
dis = new DataInputStream(p.getInputStream());
byte[] buf = new byte[512];
int readed = 0;
while ((readed = dis.read(buf)) > -1)
{
result += new String(buf, 0, readed, "GBK");
}
}
catch (Exception e)
{
//if (e instanceof IOException)
//{
// throw (IOException) e;
//}
e.printStackTrace();
}
finally
{
dis.close();
p.destroy();
}
return result;
}
}
怎么让这段代码在WINFORM里运行成功?