console

Using Console.SetCursorPosition asynchronously

无人久伴 提交于 2020-12-13 03:19:28
问题 To experiment with updating percentages of progress items in the console, I've made a small test console application: using System; using System.Collections.Generic; using System.Diagnostics; using System.Threading; using System.Threading.Tasks; namespace ConsoleProgressTest { class Program { public class ConsoleItem { public string Item { get; set; } public int ConsoleLocLeft { get; set; } public int ConsoleLocTop { get; set; } } static void Main(string[] args) { List<string> tempList =

C# Console - How to ReadLine() without a new line? ( or undo a \n or a vertical \b)

最后都变了- 提交于 2020-12-11 04:22:37
问题 I want to know if it is possible to get back to the last line when I'm at the beginning of the next line? (in C# Console, of course) I mean Console.WriteLine() cause going to the next line and I want to stay in my line even after pressing enter. (And I think there isn't another way to ReadLine without going to the next line , is there?) I found that Console.SetCursorPosition() can be useful, like below: int x, y; Console.WriteLine("Please enter the point's coordinates in this form (x,y):");

C# Console - How to ReadLine() without a new line? ( or undo a \n or a vertical \b)

懵懂的女人 提交于 2020-12-11 04:22:30
问题 I want to know if it is possible to get back to the last line when I'm at the beginning of the next line? (in C# Console, of course) I mean Console.WriteLine() cause going to the next line and I want to stay in my line even after pressing enter. (And I think there isn't another way to ReadLine without going to the next line , is there?) I found that Console.SetCursorPosition() can be useful, like below: int x, y; Console.WriteLine("Please enter the point's coordinates in this form (x,y):");

c# start new process in window mode

本秂侑毒 提交于 2020-12-06 07:51:51
问题 My c# application starting console .exe file. process is starting correctly its visible in Task manager but process running without window. How i can run console applications in window ? Code: p_info.UseShellExecute = true; p_info.CreateNoWindow = false; p_info.WindowStyle = ProcessWindowStyle.Normal; Process.Start(p_info); 回答1: here a sample which launch a visible console application from another application ProcessStartInfo p_info = new ProcessStartInfo(); p_info.UseShellExecute = true; p

c# start new process in window mode

你说的曾经没有我的故事 提交于 2020-12-06 07:51:32
问题 My c# application starting console .exe file. process is starting correctly its visible in Task manager but process running without window. How i can run console applications in window ? Code: p_info.UseShellExecute = true; p_info.CreateNoWindow = false; p_info.WindowStyle = ProcessWindowStyle.Normal; Process.Start(p_info); 回答1: here a sample which launch a visible console application from another application ProcessStartInfo p_info = new ProcessStartInfo(); p_info.UseShellExecute = true; p

From Python run WinSCP commands in console

為{幸葍}努か 提交于 2020-12-04 05:32:36
问题 I have to run a few commands of WinSCP from a Python class using subprocess. The goal is to connect a local Windows machine and a Windows server with no FTP installed and download some files. This is what I tried python proc = subprocess.Popen(['WinSCP.exe', '/console', '/WAIT', user:password@ip:folder , '/WAIT','get' ,'*.txt'], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) With this I get it to open the WinSCP console and connect to the server, but it doesn't execute the get

From Python run WinSCP commands in console

♀尐吖头ヾ 提交于 2020-12-04 05:29:31
问题 I have to run a few commands of WinSCP from a Python class using subprocess. The goal is to connect a local Windows machine and a Windows server with no FTP installed and download some files. This is what I tried python proc = subprocess.Popen(['WinSCP.exe', '/console', '/WAIT', user:password@ip:folder , '/WAIT','get' ,'*.txt'], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) With this I get it to open the WinSCP console and connect to the server, but it doesn't execute the get

From Python run WinSCP commands in console

大兔子大兔子 提交于 2020-12-04 05:28:36
问题 I have to run a few commands of WinSCP from a Python class using subprocess. The goal is to connect a local Windows machine and a Windows server with no FTP installed and download some files. This is what I tried python proc = subprocess.Popen(['WinSCP.exe', '/console', '/WAIT', user:password@ip:folder , '/WAIT','get' ,'*.txt'], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) With this I get it to open the WinSCP console and connect to the server, but it doesn't execute the get

Allowing redirection of StandardInput of a C# application when doing “Console.ReadKey”

时间秒杀一切 提交于 2020-12-03 09:46:50
问题 I have 2 applications, A & B. A calls B within a Process. B do some stuffs like Console.WriteLine and Console.ReadLine Thanks to this MSDN Article, I manage somehow to redirect the output of B and to feed its input as well. What I don't manage to do , is to have the Console.ReadKey function in B work. I made a try catch block arround this function and I got this error message: Cannot read keys when either application does not have a console, or when console input has been redirected from a

Allowing redirection of StandardInput of a C# application when doing “Console.ReadKey”

匆匆过客 提交于 2020-12-03 09:45:10
问题 I have 2 applications, A & B. A calls B within a Process. B do some stuffs like Console.WriteLine and Console.ReadLine Thanks to this MSDN Article, I manage somehow to redirect the output of B and to feed its input as well. What I don't manage to do , is to have the Console.ReadKey function in B work. I made a try catch block arround this function and I got this error message: Cannot read keys when either application does not have a console, or when console input has been redirected from a