console-application

How to read values from config.json in Console Application

ぐ巨炮叔叔 提交于 2019-12-21 04:38:04
问题 I just installed ASP.NET 5 and created a Console Application in Visual Studio. I've added a file, config.json, to the root folder of the project. It looks like this: { "Data": { "TargetFolderLocations": { "TestFolder1": "Some path", "TestFolder2": "Another path" } } } My Program.cs looks like this public void Main(string[] args) { var configurationBuilder = new ConfigurationBuilder(Environment.CurrentDirectory) .AddJsonFile("config.json") .AddEnvironmentVariables(); Configuration =

Multiple Consoles in a Single Console Application

女生的网名这么多〃 提交于 2019-12-21 04:23:57
问题 I have created a C# Project which has multiple console applications in it. Now my question is: Is it possible to display multiple consoles when I run one application? if yes, how? Lets say, I have a Test Application, which is the main application. I have another two Console applications say, ABC and XYZ . Now, when i run the Test Application, the console of both applications ABC and XYZ should appear. I have written the following code: Console.WriteLine("\n\t Calling EXE..."); Process

Embed a Console Window inside a WPF Window

不问归期 提交于 2019-12-21 03:42:43
问题 Is it possible to embed a console window inside a WPF window? As a little background, at first, I tried to implement a console window from scratch in WPF, which was successful except for one huge problem -- it is extremely slow. See the question here: VT100 Terminal Emulation in Windows WPF or Silverlight Since that does not seem to be an option I am instead looking at hosting an actual console window in my WPF application, which I've learned how to do as described here: No output to console

How to reserve a row for input in multi-threaded Console?

守給你的承諾、 提交于 2019-12-20 20:01:10
问题 This question has bugged me for a while now, and I realize it's hard to describe what I am looking for. I want to be able to reserve a row for text input in a C# Console Application, while still allowing other information to be updated in the remaining rows. More specifically, I'd like to make a small mud game where the game is updated even while the user is busy making input. It's important that the input doesn't block the information flow. I'd like to achieve the effect of the user writing

.net application failing when fired via scheduled task

风格不统一 提交于 2019-12-20 14:48:10
问题 I have a .net console application written in c# which does exactly what it should when run inside visual studio and when clicking the .exe file in the file system. It runs like a charm. BUT when I create a scheduled windows task either in my Windows 7 dev machine or the Windows 2008 R2 prod machine it fails to carry out the last step in the application. This step is to open a .doc in the background and covert it (simply running a save as) to a .docx. The application is designed to visita

.net application failing when fired via scheduled task

我只是一个虾纸丫 提交于 2019-12-20 14:43:13
问题 I have a .net console application written in c# which does exactly what it should when run inside visual studio and when clicking the .exe file in the file system. It runs like a charm. BUT when I create a scheduled windows task either in my Windows 7 dev machine or the Windows 2008 R2 prod machine it fails to carry out the last step in the application. This step is to open a .doc in the background and covert it (simply running a save as) to a .docx. The application is designed to visita

Suppress 3rd party library console output?

余生颓废 提交于 2019-12-20 11:51:14
问题 I need to call a 3rd party library that happens to spew a bunch of stuff to the console. The code simply like this... int MyMethod(int a) { int b = ThirdPartyLibrary.Transform(a); // spews unwanted console output return b; } Is there an easy way to suppress the unwanted console output from ThirdPartyLibrary? For performance reasons, new processes or threads cannot be used in the solution. 回答1: Well you can use Console.SetOut to an implementation of TextWriter which doesn't write anywhere:

Suppress 3rd party library console output?

假装没事ソ 提交于 2019-12-20 11:51:09
问题 I need to call a 3rd party library that happens to spew a bunch of stuff to the console. The code simply like this... int MyMethod(int a) { int b = ThirdPartyLibrary.Transform(a); // spews unwanted console output return b; } Is there an easy way to suppress the unwanted console output from ThirdPartyLibrary? For performance reasons, new processes or threads cannot be used in the solution. 回答1: Well you can use Console.SetOut to an implementation of TextWriter which doesn't write anywhere:

Implement a C# Client that uses WebServices over SSL?

北城余情 提交于 2019-12-20 09:06:27
问题 So I've got a ServiceReference added to a C# Console Application which calls a Web Service that is exposed from Oracle. I've got everything setup and it works like peaches when it's not using SSL (http). I'm trying to set it up using SSL now, and I'm running into issues with adding it to the Service References (or even Web References). For example, the URL (https) that the service is being exposed on, isn't returning the appropriate web methods when I try to add it into Visual Studio. The

How to create ASCII animation in Windows Console application using C#?

爷,独闯天下 提交于 2019-12-20 08:39:20
问题 I would like it to display non-flickery animation like this awesome Linux command; sl http://www.youtube.com/watch?v=9GyMZKWjcYU I would appreciate a small & stupid example of say ... a fly. Thanks! 回答1: Just use Console.SetCursorPosition for moving the cursor to a certain position, then Console.Write a character. Before each frame you have to delete the previous one by overwriting it with spaces. Heres a little example I just built: class Program { static void Main(string[] args) { char[]