Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

C# console applications & highlighting output to screen


  • Please log in to reply
1 reply to this topic

#1 BobLewiston

BobLewiston

  • Members
  • 69 posts
  • OFFLINE
  •  
  • Local time:05:33 PM

Posted 09 January 2009 - 06:53 PM

In a C# console application, can anyone tell me how to "highlight" certain characters, that is, print them brighter than other characters?

BC AdBot (Login to Remove)

 


#2 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:02:33 PM

Posted 09 January 2009 - 07:25 PM

Hello :thumbsup:

You may wish to see the native win32 api reference for working with the console:
http://msdn.microsoft.com/en-us/library/ms682073(VS.85).aspx

You'll have to map these functions into .NET.

You may also like to see .NET equivalents in the cross reference table:
http://msdn.microsoft.com/en-us/library/aa...onsolefunctions

EDIT: .NET doesn't really natively support that function. You'll have to call out to win32.

EDIT2:
You'll probably want "WriteConsoleOutput", which writes character and color attribute data to a specified rectangular block of character cells in a console screen buffer.

Billy3

Edited by Billy O'Neal, 09 January 2009 - 07:50 PM.

Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users