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

C#

 
Questionmy application with graphic Pin
Sasuko31-Jan-06 10:02
Sasuko31-Jan-06 10:02 
QuestionThreading Pin
nc3b31-Jan-06 9:48
nc3b31-Jan-06 9:48 
AnswerRe: Threading Pin
Le centriste31-Jan-06 10:13
Le centriste31-Jan-06 10:13 
GeneralRe: Threading Pin
nc3b31-Jan-06 10:15
nc3b31-Jan-06 10:15 
Questiondo I need a lience to use word.dll in a commercial product Pin
Agyeman31-Jan-06 9:38
Agyeman31-Jan-06 9:38 
AnswerRe: do I need a lience to use word.dll in a commercial product Pin
Praveen Nayak31-Jan-06 17:20
Praveen Nayak31-Jan-06 17:20 
QuestionBinary Data & .Net Sockets, URGENT Pin
John Gouda31-Jan-06 9:27
John Gouda31-Jan-06 9:27 
QuestionHow does 1 thread multiply into 3 threads??? Pin
WetRivrRat31-Jan-06 8:27
WetRivrRat31-Jan-06 8:27 
Ok, trying to loop through a treeview and create connection to each node(pc).
Am running a new thread to do this loop as it is taxing on the application.
PcTree = new Thread(new ThreadStart(enumThread));
	PcTree.Name = "PollPCList";
	PcTree.Start();

When I look at the output of my node looping I consitently find 3 connections to each node. After trying to step thru the debugger i find that sometimes it does keep this pattern(3 connections), other times i only see one loop for each node. (how odd is that?) -- why is this happening? is it due to the fact that i'm running this on a dual-proc pc?

now, that obviously is the problem, here is my question:

if i haven't done something wrong with my code and i'm stuck with this 'triple threat thread' then is it possible that i increment the foreach loop so that i process 3 different nodes instead of just one node 3 times?
private void enumThread()
	{
		enumPCtree(PCmonitorTree.Nodes);			
	}


private void enumPCtree(TreeNodeCollection t)
	{
              try
		{
			foreach ( TreeNode tr in t)
			{ 
                              if (tr.Text.IndexOf("PC")!= -1)
				{
				  tr.Nodes.Equals(tr.NextNode);				
				}
				else
				{
				    ServerName = tr.Text;
                                       try
					{
						HostIP = System.Net.Dns.GetHostByName(ServerName);
						PcIpAddress = HostIP.AddressList[0].ToString(); 
					}
					catch
					{}
					finally
					{enumPCtree(tr.Nodes);}
					if (PcIpAddress != null)
					{	
                                          //do scan
				              if (breakLoop)
						{
							break;
						}
					}
				}
			}
		}
		catch (Exception ex)
		{MessageBox.Show(ex.Message);}
	
		finally
		{
		//End Scan
		}
}


string Beautiful;
Beautiful = "ignorant";
label1.Text = "The world is full of " + Beautiful +" people.";


Why is common sense such an un-common comodity?
AnswerRe: How does 1 thread multiply into 3 threads??? Pin
Wjousts31-Jan-06 10:59
Wjousts31-Jan-06 10:59 
QuestionHow can a custom control or form tell that it’s in design mode? Pin
Chris Levin31-Jan-06 8:09
Chris Levin31-Jan-06 8:09 
AnswerRe: How can a custom control or form tell that it’s in design mode? Pin
malharone31-Jan-06 8:33
malharone31-Jan-06 8:33 
GeneralRe: How can a custom control or form tell that it’s in design mode? Pin
Chris Levin31-Jan-06 8:35
Chris Levin31-Jan-06 8:35 
AnswerRe: How can a custom control or form tell that it’s in design mode? Pin
kasik31-Jan-06 8:42
kasik31-Jan-06 8:42 
GeneralRe: How can a custom control or form tell that it’s in design mode? Pin
malharone31-Jan-06 8:51
malharone31-Jan-06 8:51 
QuestionWierd behavior with ALT key shortcuts Pin
Dan Neely31-Jan-06 8:07
Dan Neely31-Jan-06 8:07 
QuestionHow to Call Javascript function from code behind after dialog box appearance Pin
psmukil31-Jan-06 7:49
psmukil31-Jan-06 7:49 
QuestionPosting Data to a Blog Pin
AB777131-Jan-06 3:48
AB777131-Jan-06 3:48 
AnswerRe: Posting Data to a Blog Pin
User 665831-Jan-06 4:40
User 665831-Jan-06 4:40 
AnswerRe: Posting Data to a Blog Pin
tarasn31-Jan-06 4:49
tarasn31-Jan-06 4:49 
QuestionKeypress handling in Simple DataGrid Pin
hellamasta31-Jan-06 3:44
hellamasta31-Jan-06 3:44 
AnswerRe: Keypress handling in Simple DataGrid Pin
Alomgir Miah31-Jan-06 7:54
Alomgir Miah31-Jan-06 7:54 
GeneralRe: Keypress handling in Simple DataGrid Pin
hellamasta31-Jan-06 8:44
hellamasta31-Jan-06 8:44 
Questionalternate ways to force a process to close. Pin
Dan Neely31-Jan-06 3:22
Dan Neely31-Jan-06 3:22 
AnswerRe: alternate ways to force a process to close. Pin
Wjousts31-Jan-06 5:59
Wjousts31-Jan-06 5:59 
GeneralRe: alternate ways to force a process to close. Pin
Dan Neely31-Jan-06 7:32
Dan Neely31-Jan-06 7:32 

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.