Click here to Skip to main content
15,913,487 members
Home / Discussions / C#
   

C#

 
AnswerRe: winform app Pin
IdUnknown4-Nov-05 9:15
IdUnknown4-Nov-05 9:15 
GeneralRe: winform app Pin
Manu_814-Nov-05 9:19
Manu_814-Nov-05 9:19 
AnswerRe: winform app Pin
Carl Mercier4-Nov-05 10:26
Carl Mercier4-Nov-05 10:26 
QuestionHow to recognize a string's colour Pin
ventomito4-Nov-05 6:56
ventomito4-Nov-05 6:56 
AnswerRe: How to recognize a string's colour Pin
S. Senthil Kumar4-Nov-05 21:33
S. Senthil Kumar4-Nov-05 21:33 
QuestionHow to get started developing a control Pin
BambooMoon4-Nov-05 6:52
BambooMoon4-Nov-05 6:52 
QuestionHow to check object==null for objects without Constructor? Pin
artisticcheese4-Nov-05 6:05
artisticcheese4-Nov-05 6:05 
AnswerRe: How to check object==null for objects without Constructor? Pin
whizzs4-Nov-05 7:27
whizzs4-Nov-05 7:27 
QuestionLoading Files Pin
zaboboa4-Nov-05 5:53
zaboboa4-Nov-05 5:53 
AnswerRe: Loading Files Pin
User 66584-Nov-05 7:32
User 66584-Nov-05 7:32 
GeneralRe: Loading Files Pin
zaboboa4-Nov-05 8:13
zaboboa4-Nov-05 8:13 
AnswerRe: Loading Files Pin
whizzs4-Nov-05 7:37
whizzs4-Nov-05 7:37 
AnswerRe: Loading Files Pin
Jon Rista4-Nov-05 16:16
Jon Rista4-Nov-05 16:16 
Questionget GC to collect unused memory Pin
Stefan Fohringer4-Nov-05 5:06
Stefan Fohringer4-Nov-05 5:06 
AnswerRe: get GC to collect unused memory Pin
Dan Neely4-Nov-05 5:32
Dan Neely4-Nov-05 5:32 
AnswerRe: get GC to collect unused memory Pin
Dave Kreskowiak4-Nov-05 5:52
mveDave Kreskowiak4-Nov-05 5:52 
GeneralRe: get GC to collect unused memory Pin
Jon Rista4-Nov-05 16:33
Jon Rista4-Nov-05 16:33 
GeneralRe: get GC to collect unused memory Pin
Dave Kreskowiak5-Nov-05 2:49
mveDave Kreskowiak5-Nov-05 2:49 
GeneralRe: get GC to collect unused memory Pin
Jon Rista5-Nov-05 9:57
Jon Rista5-Nov-05 9:57 
QuestionMost elegant way to query 400 computers in C#? Pin
artisticcheese4-Nov-05 4:44
artisticcheese4-Nov-05 4:44 
AnswerRe: Most elegant way to query 400 computers in C#? Pin
Rob Graham4-Nov-05 5:14
Rob Graham4-Nov-05 5:14 
GeneralRe: Most elegant way to query 400 computers in C#? Pin
artisticcheese4-Nov-05 5:17
artisticcheese4-Nov-05 5:17 
AnswerRe: Most elegant way to query 400 computers in C#? Pin
S. Senthil Kumar4-Nov-05 21:39
S. Senthil Kumar4-Nov-05 21:39 
You can use the ThreadPool class provided by the .NET Framework, but it's not really recommended for executing long running operations (in the order of 20 seconds). You can find plenty of implementations for ThreadPools if you search around in CP. In any case, the idea is the same.
void YourMainFunc()
{
  for (int i =0; i<listOfIPs.Length; ++i)
  {
     ThreadPool.QueueItem(ThreadFunc, listOfIPs[i]);
  }
}

void ThreadFunc(string IP)
{
   if (SuccessfulQuery(IP))
   {
      UpdateDataSet(IP);
   }
}

void UpdateDataSet(IP)
{
   lock(xyz)
   {
      //make changes to dataset
   }
}


Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
GeneralRe: Most elegant way to query 400 computers in C#? Pin
artisticcheese5-Nov-05 2:31
artisticcheese5-Nov-05 2:31 
GeneralRe: Most elegant way to query 400 computers in C#? Pin
S. Senthil Kumar5-Nov-05 3:17
S. Senthil Kumar5-Nov-05 3:17 

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.