System.Diagnostics.Process.Start(@"C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe")
從計時器執行時不起作用Windows服務的事件?System.Diagnostics.Process.Start()
-1
A
回答
3
此代碼可能會幫助您System.Diagnostics.Process.Start Class
using System;
using System.Diagnostics;
using System.ComponentModel;
namespace MyProcessSample
{
class MyProcess
{
public static void Main()
{
Process myProcess = new Process();
try
{
myProcess.StartInfo.UseShellExecute = false;
// You can start any process, HelloWorld is a do-nothing example.
myProcess.StartInfo.FileName = "C:\\HelloWorld.exe";
myProcess.StartInfo.CreateNoWindow = true;
myProcess.Start();
// This code assumes the process you are starting will terminate itself.
// Given that is is started without a window so you cannot terminate it
// on the desktop, it must terminate itself or you can do it programmatically
// from this application using the Kill method.
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}
2
的Windows服務的用戶的交互式會話之外運行的,所以雖然在執行過程中是可能的,你不應該期待一個新窗口中打開(在你的情況下, acrobat reader的實例)。
此外,基於運行服務的用戶,您經常會對您可以或不可以執行的操作有安全限制。
+0
我開始以下錯誤:應用程序未能正確初始化(0xc0000142) – 2010-12-22 09:59:52
0
相關問題
- 1. System.Diagnostics.Process.Start問題
- 2. C#System.Diagnostics.Process.Start()參數
- 3. 傳遞文件流到System.Diagnostics.Process.Start
- 4. 使用System.Diagnostics.Process.Start啓動服務
- 5. 如何等待,直到System.Diagnostics.Process.Start完成
- 6. 爲什麼我的System.Diagnostics.Process.Start不能工作?
- 7. System.Diagnostics.Process.Start()打開/運行錯誤的目錄?
- 8. Windows Server 2008上的System.Diagnostics.Process.Start()問題
- 9. C#執行EXE不使用System.Diagnostics.Process.Start
- 10. 類似於System.Diagnostics.Process.Start來運行流
- 11. 從System.Diagnostics.Process.Start()方法啓動的進程訪問註冊表項
- 12. C#4.0:有沒有一種方法來檢查,如果在System.Diagnostics.Process.Start
- 13. System.Diagnostics.Process.Start()從Windows服務調用時無法啓動進程
- 14. System.Diagnostics.Process.Start with WindowStyle.Hidden不會重新執行句柄
- 15. System.Diagnostics.Process.Start(「Notepad.exe」);不在現場服務器上工作
- 16. System.Diagnostics.Process.Start不使用IIS,ASP.NET,但開發服務器上
- 17. 使用System.Diagnostics.Process.Start運行程序會導致MissingMethodException
- 18. System.Diagnostics.Process.Start for mailto無法在測試服務器上工作
- 19. System.Diagnostics.Process.Start在服務器上拋出threadbort異常
- 20. 從SQL CLR函數中調用System.Diagnostics.Process.Start,該函數包含與xml的參數
- 21. C#:System.Diagnostics.Process.Start(「Explorer.exe」,@「/ select」+ FilePath)。當文件名是unicode字符時無法打開文件
- 22. 當提供用戶帳戶時,System.Diagnostics.Process.Start在啓動時不起作用
- 23. System.Diagnostics.Process.Start(OutputFileName)的作品在本地計算機上而不是在網絡服務器 - vb.net
- 24. 如何啓動和從一個窗口服務
- 25. 我如何可以運行.bat文件以下
- 26. 打開/瀏覽受密碼保護的映射網絡驅動器
- 27. 用c在mac上啓動外部進程#
- 28. 無法在Visual C中打開其他窗體窗口#
- 29. C# - 打開瀏覽器,Intranet上的按鈕,點擊
- 30. C#語音識別商店詞
也許你想詳細說明它是如何「不起作用」的。例如。是拋出的異常? – Reddog 2010-12-22 09:52:03