2009-12-05 53 views
0

我們有一些傳統軟件,它依賴於向DOS窗口發送按鍵,然後刮屏。我試圖通過將流程的輸入和輸出流直接重定向到我的應用程序來重新創建軟件。我一直在使用管理精細這一部分:.NET StandardInput發送修改器

_Process = new Process(); 
{ 
    _Process.StartInfo.FileName = APPLICATION; 
    _Process.StartInfo.RedirectStandardOutput = true; 
    _Process.StartInfo.RedirectStandardInput = true; 
    _Process.StartInfo.RedirectStandardError = true; 
    _Process.StartInfo.UseShellExecute = false; 
    _Process.StartInfo.CreateNoWindow = true; 
    _Process.OutputDataReceived += new DataReceivedEventHandler(_Process_OutputDataReceived); 
    _Process.ErrorDataReceived += new DataReceivedEventHandler(_Process_ErrorDataReceived); 
} 

我的問題是我需要發送一些指令調節劑,如Ctrl,Alt和空間以及F1-12這個過程,但我不知道該如何。我可以發送基本文本,並收到回覆的罰款。我只需要模仿這些修飾符。

+0

我發現通過C#中的管道發送鍵盤修改器是不可能的。有誰知道我是否可以用其他語言做到這一點? – 2010-05-14 01:09:12

回答

0

看看這個table關鍵代碼,看到它你可以發送兩個關鍵代碼,並讓他們工作。