Click here to Skip to main content
15,900,110 members
Home / Discussions / C#
   

C#

 
QuestionHow to log before window shutdowned! Pin
tranglt6-Oct-07 1:26
tranglt6-Oct-07 1:26 
AnswerRe: How to log before window shutdowned! Pin
Anthony Mushrow6-Oct-07 1:47
professionalAnthony Mushrow6-Oct-07 1:47 
AnswerRe: How to log before window shutdowned! Pin
Abhijit Jana6-Oct-07 2:26
professionalAbhijit Jana6-Oct-07 2:26 
QuestionClient-Server [modified] Pin
Aamu6-Oct-07 1:05
Aamu6-Oct-07 1:05 
QuestionThreading Pin
udikantz6-Oct-07 0:46
udikantz6-Oct-07 0:46 
AnswerRe: Threading Pin
lmoelleb6-Oct-07 1:00
lmoelleb6-Oct-07 1:00 
GeneralRe: Threading Pin
udikantz6-Oct-07 1:52
udikantz6-Oct-07 1:52 
GeneralRe: Threading Pin
lmoelleb6-Oct-07 3:35
lmoelleb6-Oct-07 3:35 
beleive me, a lot of people do NOT consult MSDN or Google before asking, you are the (positive) exception here. Smile | :)

But to answer your question - No, you do not need anything different.

Where you have written "//Some code i dont know how to implement" the code (pseudo code, I am not sure delegate names and signatures match - find them in MSDN) is as follows:
<br />
ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadMethod));<br />
} // Here you end the current method letting the main thread return to what it did before<br />
<br />
private void ThreadMethod() // give it a signature matching the delegate<br />
{<br />
  //Perform thread code here.<br />
}<br />

Depoending on how much control you want with the thread, you can use one of the alternatives (create a Thread object etc) instead of the ThreadPool.

If you REALLY want it in the same method you can replace the "new WaitCallback(ThreadMethod)" part with an anonymous delegate. But I really recommend you try to think of starting threads as follows:
1) The creating thread continues execution in the current method
2) The new thread starts running in a new method/scope.

it will help you later on as this is how the thread methods are designed - and how they are used by most developers.
GeneralRe: Threading Pin
udikantz6-Oct-07 6:16
udikantz6-Oct-07 6:16 
Questionhow to check the files are exist or not in a floder Pin
ramyanaidu5-Oct-07 22:45
ramyanaidu5-Oct-07 22:45 
AnswerRe: how to check the files are exist or not in a floder Pin
Hessam Jalali5-Oct-07 23:03
Hessam Jalali5-Oct-07 23:03 
AnswerRe: how to check the files are exist or not in a floder Pin
Abhijit Jana5-Oct-07 23:52
professionalAbhijit Jana5-Oct-07 23:52 
QuestionCancelling a background worker Pin
Muammar©5-Oct-07 22:40
Muammar©5-Oct-07 22:40 
AnswerRe: Cancelling a background worker Pin
Hessam Jalali6-Oct-07 0:19
Hessam Jalali6-Oct-07 0:19 
GeneralRe: Cancelling a background worker Pin
Muammar©6-Oct-07 0:39
Muammar©6-Oct-07 0:39 
GeneralRe: Cancelling a background worker Pin
Hessam Jalali6-Oct-07 1:00
Hessam Jalali6-Oct-07 1:00 
GeneralRe: Cancelling a background worker Pin
Muammar©6-Oct-07 1:33
Muammar©6-Oct-07 1:33 
QuestionCopying files to clipboard?? Pin
Muammar©5-Oct-07 22:19
Muammar©5-Oct-07 22:19 
AnswerRe: Copying files to clipboard?? Pin
pmarfleet5-Oct-07 22:37
pmarfleet5-Oct-07 22:37 
GeneralRe: Copying files to clipboard?? Pin
Muammar©5-Oct-07 22:53
Muammar©5-Oct-07 22:53 
GeneralRe: Copying files to clipboard?? Pin
User 66586-Oct-07 2:11
User 66586-Oct-07 2:11 
GeneralRe: Copying files to clipboard?? Pin
Muammar©6-Oct-07 11:31
Muammar©6-Oct-07 11:31 
QuestionUsers in local users and groups Pin
Surya Ayyagari5-Oct-07 22:02
Surya Ayyagari5-Oct-07 22:02 
AnswerRe: Users in local users and groups [modified] Pin
Hessam Jalali5-Oct-07 23:57
Hessam Jalali5-Oct-07 23:57 
QuestionSelecting an item in a listbox control Pin
Muammar©5-Oct-07 21:43
Muammar©5-Oct-07 21:43 

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.