console-application

Redirect console to Visual Studio debug output window in app.config

跟風遠走 提交于 2019-11-29 13:19:23
I want to get my Console.WriteLine() commands to appear in my "Output" window with my Debug.WriteLine() statements. I think I figured out how to do this once, but I can't remember / find on google how to do it again. I seem to remember being able to do this in the app.config file. I find plenty of instructions on how to get console and debug statements to appear in the output of the Console, but not how to get them to appear in the "Output" window. Is it possible? Avram Basically the most simple solution looks like this. public class ToDebugWriter : StringWriter { public override void

The type or namespace name 'Ping' could not be found, although there is a dependencie and a using

那年仲夏 提交于 2019-11-29 12:35:32
I am creating a little program to ping a computer within a network. For this i am trying to use the class ping, from namespace System.Net.NetworkInformation.Ping I am using ASP.NET 5.0 so i hava project.json file with my dependecies { "version": "1.0.0-*", "dependencies": { "NetworkSniffer": "1.0.0-*", "Microsoft.AspNet.Mvc": "6.0.0.0-beta2" }, "commands": { "run": "run" }, "frameworks": { "aspnet50": { "dependencies": { "System.Console": "4.0.0-beta-22231", "System.Net.NetworkInformation": "4.0.10-beta-22231" } }, "aspnetcore50": { "dependencies": { "System.Console": "4.0.0-beta-22231",

C++ console application always on top? [closed]

老子叫甜甜 提交于 2019-11-29 12:12:59
I am NOT looking for: making another window always on top making any sort of GUI - dialogs etc... on top I am however looking for a way how to make my simple C++ console application to stay always on top, just to be clear - I am looking for a way how to do this programaticly :) I tried hard searching but only found the above - what I do not want... So is there a way how to make your console app always on top programaticly in C++ on Windows ? PS: Yes there is an existing question with a coresponding title but the OP of that question is actually looking for something else (keyboard hooks,...) -

Windows console application - signal for closing event

て烟熏妆下的殇ゞ 提交于 2019-11-29 11:54:49
In windows console application, one can catch pressing ctrl+c by using: #include <stdio.h> #include <signal.h> void SigInt_Handler(int n_signal) { printf("interrupted\n"); } int main(int n_arg_num, const char **p_arg_list) { signal(SIGINT, &SigInt_Handler); getchar(); // wait for user intervention } This works well, except it does not work at all if the user presses the cross × that closes the console window. Is there any signal for that? The reason I need this is I have this CUDA application which tends to crash the computer if closed while computing something. The code is kind of

Colorize stdout output to Windows cmd.exe from console C++ app

半腔热情 提交于 2019-11-29 11:08:28
I would like to write something similar to cout << "this text is not colorized\n"; setForeground(Color::Red); cout << "this text shows as red\n"; setForeground(Color::Blue); cout << "this text shows as blue\n"; for a C++ console program running under Windows 7. I have read that global foreground & background can be changed from cmd.exe's settings, or by calling system() - but is there any way to change things at character-level that can be coded into a program? At first I thought "ANSI sequences", but they seem to be long lost in the Windows arena. You can use SetConsoleTextAttribute function:

readline-like library for Java [closed]

跟風遠走 提交于 2019-11-29 10:47:24
Which readline-like library for Java do you use? By 'readline' like library I mean library for editing console input, with support for history, tab-completion, and stuff like this. I'm looking for one, and I cannot choose from so many choices ( jLine -- unmaintained, java-readline -- last release on 2003, others?) I've used JLine to add history, etc. to a Clojure REPL (JVM process) when executed from the command line. It just magically worked and worked well, so I never bothered to investigate anything else. jruby has an internal readline you could probably call out to. 来源: https:/

How to get the current directory path of application's shortcut

江枫思渺然 提交于 2019-11-29 10:38:10
I want to get the current directory path but not of the application location but of it's shortcut location. I tried these but they return the application's location. Directory.GetCurrentDirectory(); Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase); Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); Path.GetDirectoryName(Environment.GetCommandLineArgs()[0]); If adding a COM Object reference is not a problem , Add COM Object Reference - Windows Script Host Object Model i ran this code in my desktop folder and it did work. for

Countdown timer in console Application [duplicate]

放肆的年华 提交于 2019-11-29 10:21:32
This question already has an answer here: How can I update the current line in a C# Windows Console App? 15 answers I have a console application and I want to create a countdown timer. This is what I have tried: static void Main(string[] args) { for (int a = 10; a >= 0; a--) { Console.Write("Generating Preview in {0}", a); System.Threading.Thread.Sleep(1000); Console.Clear(); } } This code works in some situations. However, the problem is that it clears the entire console window and cannot be used when there are some characters above the timer. There are two ways i know of doing what you want

How To Get A Stream Object From A Resource File (Console App/Windows Service Project)

拟墨画扇 提交于 2019-11-29 09:59:57
I'm creating a Windows service and am trying to access some files I added to a resource file, but I'm stuck because I don't know how to access the individual files. Just for some background info, here's what I've done so far: This is a C# Windows Service application running in debug mode as a console app, which helps me step into the code. I added a resource file to the root called "Resources.resx". In my resource file, I added a few jpg images and html files using the visual designer/editor. After I added the images and html files to the resource file, a new folder in my project appeared

console application gui for python

六眼飞鱼酱① 提交于 2019-11-29 08:30:14
We have console application option in C#, but how do I can make a console GUI in python? I should note I want to compile and use my program in windows. Also I want to select Items in Python GUI by Enter button. If you're using Windows you will ultimately need to integrate with the win32 console API to create a console GUI (aka. a Text UI or TUI). Your options are basically: Write your TUI using curses or the packages that sit on top of it, like urwid or npyscreen. To do this you either need to install cygwin or PDcurses to make it work. Write to the win32 API directly using something like