console-application

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

倾然丶 夕夏残阳落幕 提交于 2019-11-28 06:32:29
问题 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":

Instantiate a random class on program start

我的未来我决定 提交于 2019-11-28 06:27:07
问题 I'm just having a play around with inheritance and a few other concepts at the moment. I have created a console app that amongst other things, holds the following classes: Public abstract Organism Public abstract Animal : Organism Public Bird : Animal Public Mammal : Animal Public Reptile : Animal Public Fish : Animal Public Amphibian : Animal Public Human : Organism When the console app starts, I want to create a new object from either the Human, Fish, Mammal, Reptile, Bird or Amphibian

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

↘锁芯ラ 提交于 2019-11-28 06:03:37
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 years ago . 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

Can you execute another EXE file from within a C# console application?

喜欢而已 提交于 2019-11-28 05:53:30
Can you execute another EXE file from within a C# console application? Can you pass arguments? Can you get the exit code back? Like this: var proc = new Process(); proc.StartInfo.FileName = "something.exe"; proc.StartInfo.Arguments = "-v -s -a"; proc.Start(); proc.WaitForExit(); var exitCode = proc.ExitCode; proc.Close(); Yes, yes and yes. See the System.Diagnostics.Process class. 来源: https://stackoverflow.com/questions/1832962/can-you-execute-another-exe-file-from-within-a-c-sharp-console-application

Is there a way to delete a character that has just been written using Console.WriteLine?

人走茶凉 提交于 2019-11-28 04:06:49
Is there any way to delete the last character from the console, i.e. Console.WriteLine("List: apple,pear,"); // Somehow delete the last ',' character from the console. Console.WriteLine("."); // Now the console contains "List: apple,pear." Sure, I could create a string first then print that to the console, but I'm just curious to see if I can delete characters directly from the console. "\b" is ASCII backspace. Print it to back up one char. Console.Write("Abc"); Console.Write("\b"); Console.Write("Def"); outputs "AbDef"; As pointed out by Contango and Sammi, there are times where overwriting

readline-like library for Java [closed]

给你一囗甜甜゛ 提交于 2019-11-28 04:03:37
问题 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?) 回答1: 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

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

你离开我真会死。 提交于 2019-11-28 04:02:30
问题 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]); 回答1: If adding a COM Object reference is not a problem , Add COM Object

Countdown timer in console Application [duplicate]

☆樱花仙子☆ 提交于 2019-11-28 03:38:44
问题 This question already has an answer here: How can I update the current line in a C# Windows Console App? 16 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

Console.ReadLine(“Default Text Editable Text On Line”)

ε祈祈猫儿з 提交于 2019-11-28 03:10:35
问题 Is there way of achieving this? I want to pass some text and have it appear on the input line -- instead of " Enter your Name:<cursor> ", I want " Enter your Name:Default Editable Text<cursor> " 回答1: Ok, found it. Sorry. static void Main(string[] args) { Console.Write("Your editable text:"); SendKeys.SendWait("hello"); //hello text will be editable :) Console.ReadLine(); } 回答2: Assign the default value to your string and replace it only if the user has entered something. Dim name, s As String

Cooler ASCII Spinners? [closed]

做~自己de王妃 提交于 2019-11-28 02:31:12
In a console app, an ascii spinner can be used, like the GUI wait cursor, to indicate that work is being done. A common spinner cycles through these 4 characters: '|', '/', '-', '\' What are some other cyclical animation sequences to spice up a console application? Balloons... . o O @ * Joe Koberg Lots of choices with Unicode, including ⌚ and ⌛! ← ↖ ↑ ↗ → ↘ ↓ ↙ ▁ ▂ ▃ ▄ ▅ ▆ ▇ █ ▇ ▆ ▅ ▄ ▃ ▁ ▉▊▋▌▍▎▏▎▍▌▋▊▉ ▖ ▘ ▝ ▗ ┤ ┘ ┴ └ ├ ┌ ┬ ┐ ◢ ◣ ◤ ◥ ◰ ◳ ◲ ◱ ◴ ◷ ◶ ◵ ◐ ◓ ◑ ◒ ◡◡ ⊙⊙ ◠◠ ⣾⣽⣻⢿⡿⣟⣯⣷ ⠁⠂⠄⡀⢀⠠⠐⠈ The entire braille block, even in random order http://www.fileformat.info/info/unicode/block/braille_patterns