windows-console

How can i add a console output to a windows wpf application C#

五迷三道 提交于 2020-08-24 07:48:28
问题 i would like to add an additional console window to log realtine info from my wpf application. Any idea?? Bayo answer: console application in the project properties works for me. thank's 回答1: Don't do it. Take a look at log4net or NLog for log output into a file. With the right configuration of those frameworks you get a lot more power (different log levels, automatic timestamps, automatic class names in front of every logged line) And while you are at it, you might also want to implement a

How can i add a console output to a windows wpf application C#

不羁的心 提交于 2020-08-24 07:48:13
问题 i would like to add an additional console window to log realtine info from my wpf application. Any idea?? Bayo answer: console application in the project properties works for me. thank's 回答1: Don't do it. Take a look at log4net or NLog for log output into a file. With the right configuration of those frameworks you get a lot more power (different log levels, automatic timestamps, automatic class names in front of every logged line) And while you are at it, you might also want to implement a

Output unicode strings in Windows console app

大兔子大兔子 提交于 2020-03-04 15:35:51
问题 Hi I was trying to output unicode string to a console with iostreams and failed. I found this: Using unicode font in c++ console app and this snippet works. SetConsoleOutputCP(CP_UTF8); wchar_t s[] = L"èéøÞǽлљΣæča"; int bufferSize = WideCharToMultiByte(CP_UTF8, 0, s, -1, NULL, 0, NULL, NULL); char* m = new char[bufferSize]; WideCharToMultiByte(CP_UTF8, 0, s, -1, m, bufferSize, NULL, NULL); wprintf(L"%S", m); However, I did not find any way to output unicode correctly with iostreams. Any

SSH.NET CreateShellStream()

百般思念 提交于 2020-02-21 07:01:59
问题 I am building an application, SWSH, which is a ssh client. I am having trouble using the CreateShellStream() function. My code: using (var ssh = new SshClient(ccinfo)) { var keepgoing = true; ssh.Connect(); string terminalName = "xterm-256color"; uint columns = 80; uint rows = 160; uint width = 80; uint height = 160; // arbitrarily chosen int bufferSize = 500; IDictionary<Renci.SshNet.Common.TerminalModes, uint> terminalModeValues = null; var actual = ssh.CreateShellStream(terminalName,

How do I read the contents from an open Windows Console (Command Prompt) using Java Native Access

不想你离开。 提交于 2020-01-15 03:32:09
问题 I want to read the text contents of the command prompt window. Let's say, I opened a command prompt, then ran a dir command and then pwd command. So the problem statement is that, what ever is present in the command prompt I should be able to read them. I am trying to use Java Native Access library for achieving this, but didn't get any luck with it. I have tried following code. But I am not getting any output. import com.sun.jna.Native; import com.sun.jna.platform.win32.User32; import com

Restore default working dir if bat file is terminated abruptly

。_饼干妹妹 提交于 2020-01-09 07:55:06
问题 I have a scenario where during execution of a batch file, it navigates to a different folder (say to "../asdf"); and at the end of execution it will set the current working dir as the same folder from where the user called the .bat file. But if the user terminates the batch processing before it is complete, the cmd show the current working dir (say "../asdf"). But in my case, I need to restore the working dir to the default/predefined one. Is it possible? Batch file is written by me, so I can

How to get Mouse input inside a C console program on Windows-10?

丶灬走出姿态 提交于 2020-01-03 05:46:09
问题 I need to interact with user's mouse input in my simple C console program. I did some research and found a related Microsoft's docs on their page here. For a start, I copied all of their sample-code and pasted that into my editor. Upon compilation, it gets compiled well, with a nice little '.exe' which when run, tells/prints correctly all 'Key events' and 'resize events', But No Mouse event! How to successfully get mouse input inside C console program? My MCVE is the given sample-code here on

Application.exe is not a valid Win32 application error

允我心安 提交于 2020-01-01 09:12:04
问题 I have written a Console application that client is trying to run it on their Windows Server 2003 R2 machine machine and they get that error message. If I go to Build -> Configuration Manager all my projects are set to Platform of "Any CPU" and Configuration of "Release" What else I might have missed? They don't want to actually run the console application by double clicking on it, they want to give it to the Windows schedules tasks so it can pick it up and rn it on certain times 回答1: