write the escape character to the console?

N

not_a_commie

How do you send an escape key to the console? I was trying to change
the color of the text in cmd.exe with something like this:

Console.Out.Write("\u001b[1;31m");

But that doesn't seem to have any effect. I also tried 001b. Any ideas?
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

not_a_commie said:
How do you send an escape key to the console? I was trying to change
the color of the text in cmd.exe with something like this:

Console.Out.Write("\u001b[1;31m");

But that doesn't seem to have any effect. I also tried 001b. Any ideas?

You need ANSI.SYS loaded to use ANSI escape sequences.

..NET 2.0 introduced the two properties:

Console.BackgroundColor
Console.ForegroundColor

Use them instead.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top