Click here to Skip to main content
15,915,093 members
Home / Discussions / C#
   

C#

 
AnswerRe: Converting hexadecimal to string Pin
Sandeep Kumar16-Oct-07 4:53
Sandeep Kumar16-Oct-07 4:53 
AnswerRe: Converting hexadecimal to string Pin
led mike16-Oct-07 4:58
led mike16-Oct-07 4:58 
AnswerRe: Converting hexadecimal to string Pin
Pete O'Hanlon16-Oct-07 5:05
mvePete O'Hanlon16-Oct-07 5:05 
QuestionDatabinding and List Pin
shark154616-Oct-07 4:22
shark154616-Oct-07 4:22 
QuestionRegex problem [modified] Pin
laserbaronen16-Oct-07 4:17
laserbaronen16-Oct-07 4:17 
AnswerRe: Regex problem Pin
snorkie16-Oct-07 4:57
professionalsnorkie16-Oct-07 4:57 
GeneralRe: Regex problem Pin
laserbaronen16-Oct-07 5:29
laserbaronen16-Oct-07 5:29 
QuestionConsole.KeyAvailable not working for me Pin
indiie16-Oct-07 4:11
indiie16-Oct-07 4:11 
Hi
I needed to find a way to determine whether or not someone has started typing on the keyboard.

I found Console.KeyAvailable and so tried to have the following code running in it's own thread:

while (true)
{
        //Spin lock until a key is pressed
        while (Console.KeyAvailable == false) { };

        //Set flag that someone is currently typing
        isTyping = true;
        Console.WriteLine("Key pressed!");
}


And then another thread that is constantly performing a Console.ReadLine (to read keyboard input) would reset the isTyping flag to false after a successful ReadLine.

But it appears that Console.KeyAvailable never returns true even when I type on the keyboard or even hold a key down. Is it possibly affected by any other actions occurring on the Console or by threading?

Or does anyone know any other way to determine if someone has started typing? The scenario is I'm using the console window as a chat client and I only want to display server messages if the client hasn't started typing since they last sent a message.

Thanks

Glen
AnswerRe: Console.KeyAvailable not working for me Pin
laserbaronen16-Oct-07 4:27
laserbaronen16-Oct-07 4:27 
QuestionConversion error Pin
Exelioindia16-Oct-07 3:48
Exelioindia16-Oct-07 3:48 
AnswerRe: Conversion error Pin
Andrei Ungureanu16-Oct-07 4:08
Andrei Ungureanu16-Oct-07 4:08 
AnswerRe: Conversion error Pin
Hesham Amin16-Oct-07 4:11
Hesham Amin16-Oct-07 4:11 
Questionmemory stream to pdf writer Pin
k.philip16-Oct-07 3:31
k.philip16-Oct-07 3:31 
Question[Message Deleted] [modified] Pin
But_Im_a_Lady16-Oct-07 3:28
But_Im_a_Lady16-Oct-07 3:28 
AnswerRe: add a JS Function to a dynamic table created using c# Pin
Andrei Ungureanu16-Oct-07 4:02
Andrei Ungureanu16-Oct-07 4:02 
AnswerRe: add a JS Function to a dynamic table created using c# Pin
Dave Kreskowiak16-Oct-07 4:16
mveDave Kreskowiak16-Oct-07 4:16 
QuestionDTS - Data Transformation Services Pin
mihksoft16-Oct-07 2:26
mihksoft16-Oct-07 2:26 
AnswerRe: DTS - Data Transformation Services Pin
leppie16-Oct-07 2:35
leppie16-Oct-07 2:35 
QuestionGnerate Typed Dataset at runtime Pin
DotNetWWW16-Oct-07 2:02
DotNetWWW16-Oct-07 2:02 
AnswerRe: Gnerate Typed Dataset at runtime Pin
leppie16-Oct-07 2:30
leppie16-Oct-07 2:30 
QuestionEmpty rows get loaded while Parsing CSV Pin
jebin k16-Oct-07 1:57
jebin k16-Oct-07 1:57 
AnswerRe: Empty rows get loaded while Parsing CSV Pin
leppie16-Oct-07 2:33
leppie16-Oct-07 2:33 
GeneralRe: Empty rows get loaded while Parsing CSV Pin
jebin k16-Oct-07 2:44
jebin k16-Oct-07 2:44 
GeneralRe: Empty rows get loaded while Parsing CSV Pin
leppie16-Oct-07 2:58
leppie16-Oct-07 2:58 
AnswerRe: Empty rows get loaded while Parsing CSV Pin
kubben16-Oct-07 3:23
kubben16-Oct-07 3:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.