//定義一個調用Windows Mobile系統程式的方法
private static void StartProcess(string FileName)
{
try
{
if (!System.IO.File.Exists(FileName))
return;
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo.UseShellExecute = true;
myProcess.StartInfo.FileName = FileName;
myProcess.Start();
// myProcess.WaitForExit();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
StartProcess(@"\windows\iExplore.exe");//這樣就調用了系統的IE瀏覽器!類似的還有
StartProcess(@"\windows\Notes.exe");
StartProcess(@"\windows\MobileCalculator.exe");
StartLink(@"\Windows\Start Menu\Programs\Pictures & Videos.lnk");
StartProcess(@"\windows\WMPlayer.exe");
//傳遞兩個參數的方法
private static void StartProcess(string FileName, string sPath)
{
try
{
if (!System.IO.File.Exists(FileName))
return;
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo.UseShellExecute = true;
myProcess.StartInfo.FileName = FileName;
myProcess.StartInfo.Arguments = sPath;
myProcess.Start();
myProcess.WaitForExit();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}