console-application

Why is the console window closing immediately once displayed my output?

瘦欲@ 提交于 2019-11-25 22:45:31
问题 I\'m studying C# by following the guides in MSDN . Now, I just tried the Example 1 (here is the link to MSDN ), and I\'ve encountered an issue: why is the console window closing immediately once displayed my output? using System; public class Hello1 { public static int Main() { Console.WriteLine(\"Hello, World!\"); return 0; } } 回答1: the issue here is that their Hello World Program is showing up then it would immediately close. why is that? Because it's finished. When console applications

How to write Unicode characters to the console?

喜夏-厌秋 提交于 2019-11-25 22:45:16
问题 I was wondering if it was possible, in a console application, to write characters like ℃ using .NET. When I try to write this character, the console outputs a question mark. 回答1: It's likely that your output encoding is set to ASCII. Try using this before sending output: Console.OutputEncoding = System.Text.Encoding.UTF8; (MSDN link to supporting documentation.) And here's a little console test app you may find handy: C# using System; using System.Text; public static class ConsoleOutputTest {

What's a good Java, curses-like, library for terminal applications? [closed]

荒凉一梦 提交于 2019-11-25 22:44:57
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I would like to write a Java terminal application that does screen manipulation. Are there any good libraries out there that allow you to manipulate the screen like curses in the *nix/C world? Minimal features I\'m looking for are windowing and user input support. In feature-speak, I\'d like to have a region of

How can I get the application's path in a .NET console application?

十年热恋 提交于 2019-11-25 21:48:42
问题 How do I find the application\'s path in a console application? In Windows Forms, I can use Application.StartupPath to find the current path, but this doesn\'t seem to be available in a console application. 回答1: System.Reflection.Assembly.GetExecutingAssembly().Location 1 Combine that with System.IO.Path.GetDirectoryName if all you want is the directory. 1 As per Mr.Mindor's comment: System.Reflection.Assembly.GetExecutingAssembly().Location returns where the executing assembly is currently