![](/img/trans.png)
[英]C# Process.StandardOutput.Peek not working
我需要在過程中使用標准輸入/輸出,所以我創建了簡單的應用程序“測試”: 它在標准輸入上接收一些東西並在輸出上寫入。 然后我創建了新的應用程序,它需要啟動該應用程序“測試”並使用標准輸入/輸出,如: 問題是我得到這個作為輸出: “process.StandardOutput.Peek()”第二次返回 ...
[英]C# Process.StandardOutput.Peek not working
我需要在過程中使用標准輸入/輸出,所以我創建了簡單的應用程序“測試”: 它在標准輸入上接收一些東西並在輸出上寫入。 然后我創建了新的應用程序,它需要啟動該應用程序“測試”並使用標准輸入/輸出,如: 問題是我得到這個作為輸出: “process.StandardOutput.Peek()”第二次返回 ...
[英]Run command process as Admin
我有一個 Windows 窗體應用程序,其中 app.manifest 設置為: 級別="requireAdministrator" uiAccess="假"。 現在我需要從我的應用程序中運行一個控制台應用程序 (Diskspd.exe) 並返回標准輸出。 它幾乎可以工作,盡管需要 DiskSp ...
[英]Is it possible to have -RedirectStandardOutput in Start-Process but still display it in the console?
我的問題是我想Start-Process一個 powershell 文件execute.ps1 ,它將執行幾個 sql 命令,然后將輸出記錄在一個文本文件中。 到目前為止,所有其他方法,如start-transcript或*>>只寫入控制台輸出,而不是 sql PRINTS。 當前唯一有 ...
[英]C# RedirectStandardOutput from third party terminal stops at first character
我正在嘗試從第三方終端(accoreconsole.exe)重定向 output。 output 被重定向到富文本框。 如果我從 cmd 手動輸入 accoreconsole.exe,我會看到整個 output 但是當我嘗試從我的項目啟動它時,它會停在第一行的第一個字母處。 output 在字母 ...
[英]C# Redirect other console app StandardOutput fail if I won't close StardandInput
我有一個控制台應用程序的棘手問題,我試圖從中重定向 StandardInput、StandardOutput 和 StandardError。 我有一個適用於其他控制台應用程序的工作解決方案 - 這對我來說不是什么新鮮事。 但是這個應用程序似乎有一些特別之處,這使得無法使用標准方法重定向所有輸出。 ...
[英]Prompt user for input from application started via Process.start()
我目前正在創建一個控制台應用程序來與 git 交互。 這適用於將我的命令的 output 重定向到控制台應用程序,但現在一些命令提示輸入PassPhrase或y/n for owerwrite 。 如何重定向這些提示並要求用戶輸入。 ...
[英]How do you write all output streams to a variable in PowerShell?
在 PowerShell 中,我無法將錯誤 stream output 寫入變量。 Running the command without saving the output to a variable will result in output from any stream being vi ...
[英]linux - output changes on terminal when file changes
在打開的終端中,每當進程將數據寫入文件時,我如何才能看到添加到文件中的所有新內容? 我嘗試過cat和tee的組合,但沒有成功 ...
[英]About exercise 1.2.9 on p.115 in “Algorithms 4th Edition” by Robert Sedgewick and Kevin Wayne
我正在閱讀 Robert Sedgewick 和 Kevin Wayne 的“算法第 4 版”。 以下代碼是我對第 115 頁練習 1.2.9 的回答。 我希望這段代碼打印所有搜索期間檢查的鍵總數,但這段代碼不打印計數器的值。 為什么? ...
[英]In Powershell, how do you select different parts of a string and output them to variable separately and display them in line?
我正在嘗試為 FFmpeg 創建一個進度條,就像 python 的 FFpb 一樣,並且足夠遠,我可以將 FFmpeg 的 output 捕獲到變量並將所需的信息保存在變量中,但只有在它結束之后。 此命令將 FFmpeg 輸出的每一行作為對象保存到$RedirectOutput變量中:$Redir ...
[英]How can I capture the Powershell informational console output to a variable?
我似乎無法弄清楚如何捕獲下面引用的文本進行解析。 我試過將它設置為一個變量以及使用 *>&1 重定向所有流。 如何獲取輸出文本? *>&1 適用於錯誤,但出於某種原因不適用於下面的文本? 寫入文件不是一種選擇。 我也試過 警告:操作已成功完成,但在 Acti ...
[英]Redirect standard output to file and re-establish the standard output with function
I have to create a function that temporarily redirects the standard output to a file name "file", then executes the function f, then re-establishes ...
[英]How to redirect the stdout of a multiprocessing.Process
我正在使用Python 3.7.4,並且創建了兩個函數,第一個函數使用multiprocessing.Process執行可調用函數,第二個函數僅打印“ Hello World”。 在嘗試重定向標准輸出之前,一切似乎都可以正常工作,這樣做會阻止我在流程執行期間獲取任何打印值。 我已將示例最大程 ...
[英]RedirectStandardOutput crashes Process
嘗試使用C#進程在管理模式下加載第三方應用程序並讀取其輸出。 但是,當我嘗試在進程上使用RedirectStandardOutput時,它會在Windows 7 PC上啟動后幾秒鍾崩潰。 我能夠讓它在Windows 10上正常工作,但我們也需要它在Windows 7上運行。我希望有一種方法讓 ...
[英]Another way of redirecting standard output of method call in Spring Boot
我正在開發一個Spring Boot應用程序,它旨在從用戶接收代碼,編譯,執行它,最后向用戶顯示他們的代碼輸出。 為此,我創建了一個Component,負責執行代碼並將輸出保存在txt文件中(通過PrintStream ),如下所示: 上面的runClass方法由另一個@Async方法 ...
[英]C# Asynchronously read data from a redirected StandardOutput
我正在開發一種C#WFA,它允許我使用化學軟件GAMESS做一些事情。 基本上,我有一個批處理文件,當使用適當的參數執行該文件時,該文件將返回包含原子分析所需數據的文件。 在我的應用程序表單中,我使用流程的輸出設置了一個只讀文本框。 我通過重定向標准輸出來完成此操作。 此讀取以同 ...
[英]Redirect modified output of a program back to its input
為了好玩,我想在Bash中鍵入一些內容,該內容將連接到IRC服務器並自動響應PING消息 例如,我從telnet獲得以下輸出 如果將其通過管道傳輸到grep然后進行sed,則可以輕松地將此輸出轉換為PONG :12341234 ,但是如何將其發送回telnet的標准輸入流? ...
[英]How to redirect error but not output and keep text written to console in the right order? (F#)
我有兩個正在運行的程序,其中一個由另一個子進程運行。 當子進程寫到stderr時,我想在父進程中捕獲它,以便我可以判斷是否有錯誤,然后像子進程嘗試做的那樣將錯誤消息記錄到控制台。 問題是子進程在寫入stderr之后立即將幾行文本寫入stdout。 當父進程截取stderr消息並將其本身 ...
[英]Random linebreaks in PowerShell standard error output
我想用HandBrake將許多.iso文件轉換為.mp4,所以我試圖使用命令行界面。 我更願意在powershell而不是批處理文件中編寫我的腳本。 但是,如果我使用PowerShell,則標准錯誤包含隨機位置的換行符。 為了排除故障,我在PowerShell和批處理中創建了一個簡化的 ...
[英]Weird python behavior when redirecting output to file (when using os.system)
我認為有一個問題與重定向輸出(operator > )和os.system工作方式os.system 問題 這是我的代碼。 我想獲取一堆文本文件的最后2行。 它工作正常,但是輸出的組織方式讓我感到困惑 我調用python my_script.py時的標准輸出(這符合我 ...