Click here to Skip to main content
15,922,584 members
Home / Discussions / C#
   

C#

 
QuestionRe: WindowsIdentity and related classes Pin
hamidkhan27-Jun-07 0:43
hamidkhan27-Jun-07 0:43 
QuestionExporting SQL Server 2005 Reporting Services reports to PDF Pin
khuzwayom18-Jun-07 0:19
khuzwayom18-Jun-07 0:19 
QuestionChecking for a keypress in console. Pin
jblouir18-Jun-07 0:13
jblouir18-Jun-07 0:13 
AnswerRe: Checking for a keypress in console. Pin
Nissim Salomon18-Jun-07 0:49
Nissim Salomon18-Jun-07 0:49 
GeneralRe: Checking for a keypress in console. Pin
jblouir18-Jun-07 8:50
jblouir18-Jun-07 8:50 
GeneralRe: Checking for a keypress in console. Pin
jblouir18-Jun-07 8:54
jblouir18-Jun-07 8:54 
GeneralRe: Checking for a keypress in console. [modified] Pin
jblouir18-Jun-07 9:56
jblouir18-Jun-07 9:56 
GeneralThe answer. Pin
jblouir18-Jun-07 10:19
jblouir18-Jun-07 10:19 
If anyone is interested in how this is done. I basically modified it so that it reads the key in the thread inside the loop over and over, and it does things according to whatever the key is. This is just an example.

static void Main(string[] args)
{
object key = new object();
bool stopLoop = false;
ConsoleKeyInfo keyInput = new ConsoleKeyInfo();

Thread t1 = new Thread(delegate()
{
while (keyInput.Key != ConsoleKey.Escape) // repeats the below code until...
{
keyInput = Console.ReadKey(); // Constantly checks for pressed key

if (keyInput.Key == ConsoleKey.UpArrow) // does things depending on key
{
Console.WriteLine("Up Arrow");
}

if (keyInput.Key == ConsoleKey.Escape) // the loop break
{
lock (key)
{
stopLoop = true;
}
}
}
});

t1.Start();

while (true)
{
Thread.Sleep(200); // Putting a delay in so it doesnt run at a billion mph
Console.Write("01"); // Writing numbers just to visually check the speed

lock (key) // This stops the loop if Escape is pressed as defined above.
{
if (stopLoop == true)
break;
}
}
}
}
}
QuestionClose (unlock), locked File on local machine! [modified] Pin
Martin#18-Jun-07 0:10
Martin#18-Jun-07 0:10 
QuestionAlter Access Query Pin
Muhammad Faisal Khanani17-Jun-07 23:44
Muhammad Faisal Khanani17-Jun-07 23:44 
AnswerRe: Alter Access Query Pin
Muammar©17-Jun-07 23:58
Muammar©17-Jun-07 23:58 
Questionget password field [modified] Pin
kathir_techconet17-Jun-07 23:37
kathir_techconet17-Jun-07 23:37 
AnswerRe: get password field Pin
Sathesh Sakthivel17-Jun-07 23:40
Sathesh Sakthivel17-Jun-07 23:40 
JokeRe: get password field Pin
Colin Angus Mackay17-Jun-07 23:43
Colin Angus Mackay17-Jun-07 23:43 
JokeRe: get password field Pin
Muammar©17-Jun-07 23:55
Muammar©17-Jun-07 23:55 
AnswerRe: get password field Pin
marky77718-Jun-07 0:16
marky77718-Jun-07 0:16 
QuestionHow to use notifyicon with contextmenustrip in Windows Services using .Net Framework 2.0 or 3.0 Pin
jmavn17-Jun-07 23:21
jmavn17-Jun-07 23:21 
QuestionCultureInfo Problem with iTextSharp Pin
balthazar_net17-Jun-07 22:30
balthazar_net17-Jun-07 22:30 
QuestionComunicating with service application. Pin
murad basdag17-Jun-07 22:27
murad basdag17-Jun-07 22:27 
AnswerRe: Comunicating with service application. Pin
hansipet17-Jun-07 22:41
hansipet17-Jun-07 22:41 
AnswerRe: Comunicating with service application. Pin
Stefan Prodan17-Jun-07 22:53
Stefan Prodan17-Jun-07 22:53 
GeneralRe: Comunicating with service application. Pin
murad basdag18-Jun-07 0:11
murad basdag18-Jun-07 0:11 
GeneralRe: Comunicating with service application. Pin
\laddie18-Jun-07 19:24
\laddie18-Jun-07 19:24 
GeneralRe: Comunicating with service application. Pin
murad basdag18-Jun-07 23:12
murad basdag18-Jun-07 23:12 
QuestionHow Can i maximize windows throug coding in c#? Pin
help as an alias17-Jun-07 22:10
help as an alias17-Jun-07 22:10 

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.