首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

软件启动设计解决方案

2012-02-22 
软件启动设计软件主界面启动时首先要顺序调用外部的可执行文件如exe,控制台等程序等暂时命名为1.exe,2.exe

软件启动设计
软件主界面启动时首先要顺序调用外部的可执行文件如exe,控制台等程序等
暂时命名为1.exe,2.exe,3.exe...
然后把启动的信息现在在启动主程序的控制台上,比如1.exe是加载数据库,2.exe是加载配置文件等等
现在的问题是:
1.如何调用这些外部的程序?
2.调用这些外部程序后如何知道这些外部程序是否正确加载运行,并返回给启动主程序的控制台
显示调用的外部程序运行信息呢?
3.启动程序如何和调用的程序进行交互呢?


[解决办法]
Process
ProcessInfo
I/O Redirect


[解决办法]
I/O Redirect
[解决办法]

C# code
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;        }
[解决办法]
探讨

C# code

public static string GetLocalCardAddress()
{
string mac = "";

System.Diagnostics.Process process = new System.Diagnostics.Process();
process.Sta……

[解决办法]
探讨

引用:
C# code


public static string GetLocalCardAddress()
{
string mac = "";

System.Diagnostics.Process process = new System.Diagnostics.Process();
proc……

这样也是指得到相关的信息而已,……

热点排行