软件主界面启动时首先要顺序调用外部的可执行文件如exe,控制台等程序等
暂时命名为1.exe,2.exe,3.exe...
然后把启动的信息现在在启动主程序的控制台上,比如1.exe是加载数据库,2.exe是加载配置文件等等
现在的问题是:
1.如何调用这些外部的程序?
2.调用这些外部程序后如何知道这些外部程序是否正确加载运行,并返回给启动主程序的控制台
显示调用的外部程序运行信息呢?
3.启动程序如何和调用的程序进行交互呢?
暂时命名为1.exe,2.exe,3.exe...
然后把启动的信息现在在启动主程序的控制台上,比如1.exe是加载数据库,2.exe是加载配置文件等等
现在的问题是:
1.如何调用这些外部的程序?
2.调用这些外部程序后如何知道这些外部程序是否正确加载运行,并返回给启动主程序的控制台
显示调用的外部程序运行信息呢?
3.启动程序如何和调用的程序进行交互呢?
ProcessInfo
I/O Redirect
public static string GetLocalCardAddress()
{
string mac = ""; System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "ipconfig";
process.StartInfo.Arguments = "/all";
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.RedirectStandardOutput = true; process.Start();
process.WaitForExit();
string output = process.StandardOutput.ReadToEnd();
int length = output.IndexOf("Physical Address. . . . . . . . . : "); if(length>0)
{
mac = output.Substring(length+36, 17);
} return mac;
}上面是获取MAC地址的一条函数,包括你要的东西
正解另外每个Main方法都有参数列,并且也能返回状态码,都能作为你的工具。上班中……不能上代码,见谅。咩哈哈