All Questions
151 questions
-3
votes
1
answer
74
views
The writer should write to stderr
public static class Utils
{
/// <summary>
/// Creates a Writer object that writes either to a file or to a console stream.
/// </summary>
/// <param name="outFname&...
0
votes
1
answer
355
views
Windows API in Rust - How to redirect one console output to another
So I was trying to port a code from C# to Rust that can run a Windows command as another user. I got it working fine, but the problem is I want to redirect the output to current console instead of ...
0
votes
0
answers
190
views
How to access the console screen buffer in c#
I've been trying to find a way to access and edit the c# console screen buffer for a terminal based text editor, and I would rather not have to "redraw" the screen every time I need to ...
0
votes
0
answers
187
views
c# - Throwing Exceptions on Process and StandardOutput.ReadToEnd()
I'm currently in the process of creating a console application that acts as a Video Management Hub. I'm having issues with passing arguments into command line through process. Every time it returns ...
0
votes
1
answer
250
views
Read standard output from tcpdump using c#
I have read several question on how to read the standard output from a process such as these ones:
https://stackoverflow.com/a/285841/637142
https://stackoverflow.com/a/9730455/637142
and all of ...
1
vote
1
answer
1k
views
~ no response on stdout ~ C# Error while submitting code in HackerRank
I am practicing C# code on HackerRank online website, when I want to submit my code then it gives an error:
Below is my code:
for(int i=0;i<input.Count-1;i++){
string evenData="",...
1
vote
1
answer
352
views
C# write bytes to stdout adds random bytes to the output
I have the following code in a .NET 6 project:
using var stdout = Console.OpenStandardOutput();
stdout.Write(BitConverter.GetBytes((uint) 8));
stdout.Flush();
I am running from PowerShell like this ./...
0
votes
0
answers
244
views
.Net RedirectStandardOutput and RedirectStandardInput are overlapping
I am writing a prototype application that will require redirecting the stdin and stdout streams of a command-line application to a different application, and it kind of works. However, there is some ...
1
vote
0
answers
223
views
Get STDOUT and STDERR messages from referenced C++ wrapper in .NET Framework
I am using a .NET reference, which is a wrapper around a C++ unmanaged object in a .NET Framework project. Everything works fine, but I noticed when I am debugging in Visual Studio, in the Output ...
3
votes
1
answer
710
views
Continuously reading output (StdOut) from Process in C#, accessing multiple times
I'm running a process in C# that I want to run for basically the lifespan of my program. I am essentially trying to just create an interface where I can continuously send new inputs to the process and ...
0
votes
0
answers
572
views
Factorial of a number using Command Line Arguments in C#
I am practising on an online compiler. I have to write the factorial program that, given a number n from STDIN, it prints out the factorial of n to STDOUT:
I have written this
using System;
using ...
1
vote
0
answers
82
views
Problem with interacting with child process
I'm building a GUI wrapper for terraria or tModLoader dedicated server.
Firstly, I was building discord bot for manage my terraria server with python. Then I'm struck with a problem that makes me to ...
0
votes
0
answers
147
views
Read output from console dialog box
I want to get output text from the external process that runs the application and this application displays something that looks like a console dialog box like in the screenshot below:
I tried to get ...
0
votes
0
answers
95
views
c# copy (not just redirect) stdout of a process not working using joined thread
I am trying to capture the stdout of a process started in my code but still put the output to the console app that it is running.
My project is a .net core Windows application.
I attach a procedure ...
3
votes
1
answer
242
views
Unable to pipe infinite output of console app using PowerShell
During development of a console app I noticed that I'm unable to pipe its output into itself in PowerShell.
I created a small repro (source below) that works like this:
PS> .\but-why.exe print # ...