Click here to Skip to main content
15,919,422 members
Home / Discussions / C#
   

C#

 
AnswerRe: Help needed for Displaying Notification Icon Pin
Ravi Bhavnani8-Jan-07 2:50
professionalRavi Bhavnani8-Jan-07 2:50 
QuestionMultithreading Pin
indiaone7-Jan-07 21:21
indiaone7-Jan-07 21:21 
AnswerRe: Multithreading [modified] Pin
Shajeel7-Jan-07 21:55
Shajeel7-Jan-07 21:55 
GeneralRe: Multithreading Pin
indiaone7-Jan-07 23:04
indiaone7-Jan-07 23:04 
GeneralRe: Multithreading Pin
Shajeel7-Jan-07 23:07
Shajeel7-Jan-07 23:07 
GeneralRe: Multithreading Pin
indiaone7-Jan-07 23:31
indiaone7-Jan-07 23:31 
GeneralRe: Multithreading Pin
Shajeel7-Jan-07 23:45
Shajeel7-Jan-07 23:45 
GeneralRe: Multithreading Pin
indiaone7-Jan-07 23:57
indiaone7-Jan-07 23:57 
I m sending my code .
class ThreadTest
{

static void Main(string[] args)
{

StringBuilder strMethodName = new StringBuilder();
XmlDocument xmlDoc = new XmlDocument();
XmlTextReader readerXml = new XmlTextReader(@"D:\Asif\DotNetProjects\ThreadTest\ThreadTest\XSPMethod.xml");

while (readerXml.Read())
{
switch (readerXml.NodeType)
{
case XmlNodeType.Element: // The node is an element.
//Console.Write("<" + readerXml.Name);
//Console.WriteLine(">");
break;
case XmlNodeType.Text: //Display the text in each element.
//Console.WriteLine(readerXml.Value);
strMethodName.Append(readerXml.Value.ToString() + " ");
break;
case XmlNodeType.EndElement: //Display the end of the element.
//Console.Write("");
break;
}

}

ThreadTest t = new ThreadTest();
t.getData(strMethodName);

}
public void getData(StringBuilder strMethodName)
{
string[] strMName = strMethodName.ToString().Split(' ');
Console.WriteLine("Thread running");

for ( int i = 0; i < strMName.Length - 1; i++)
{
string strMN = strMName[i].ToString();
// create a thread for the Incrementer
try
{

Thread trdIncrementer = new Thread((ThreadStart)ThreadStart.CreateDelegate
(typeof(ThreadStart), new ThreadTest(), strMN));

// create a thread for the Decrementer.
Thread trdDecrementer = new Thread((ThreadStart)ThreadStart.CreateDelegate
(typeof(ThreadStart), new ThreadTest(), strMN));

trdIncrementer.Start();
trdDecrementer.Start();

}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
Console.ReadLine();
}

///
/// demo function for Incrementer, counts up to 10.
///

public void Incrementer()
{
lock (this)
{
for (int counter = 0; counter < 10; counter++)
{
// assign the incrementer value and display the results
Console.WriteLine("Incrementer: {0}", counter);
}
}
}

///
/// demo function for Decrementer, counts down from 10.
///

public void Decrementer()
{
lock (this)
{
for (int counter = 10; counter >= 0; counter--)
{
// assign the decremented value and display the results
Console.WriteLine("Decrementer: {0}", counter);
}
}
}

public void Add()
{
lock (this)
{
for (int counter = 0; counter < 10; counter++)
{
// assign the decremented value and display the results
Console.WriteLine("Addition: {0}", counter + 1);
}
}
}

}
GeneralRe: Multithreading Pin
Shajeel8-Jan-07 0:09
Shajeel8-Jan-07 0:09 
GeneralRe: Multithreading Pin
indiaone8-Jan-07 0:15
indiaone8-Jan-07 0:15 
GeneralRe: Multithreading Pin
Shajeel8-Jan-07 0:20
Shajeel8-Jan-07 0:20 
GeneralRe: Multithreading Pin
indiaone8-Jan-07 2:05
indiaone8-Jan-07 2:05 
GeneralRe: Multithreading Pin
Shajeel8-Jan-07 18:16
Shajeel8-Jan-07 18:16 
QuestionHow to access runtime methods of child form Pin
vaibhavnvag7-Jan-07 19:55
vaibhavnvag7-Jan-07 19:55 
AnswerRe: How to access runtime methods of child form Pin
Tyler457-Jan-07 20:20
Tyler457-Jan-07 20:20 
GeneralRe: How to access runtime methods of child form Pin
quiteSmart7-Jan-07 20:34
quiteSmart7-Jan-07 20:34 
AnswerRe: How to access runtime methods of child form Pin
Tyler457-Jan-07 20:47
Tyler457-Jan-07 20:47 
GeneralRe: How to access runtime methods of child form Pin
quiteSmart7-Jan-07 20:55
quiteSmart7-Jan-07 20:55 
GeneralHow to access runtime methods of child form Pin
vaibhavnvag7-Jan-07 22:40
vaibhavnvag7-Jan-07 22:40 
GeneralRe: How to access runtime methods of child form Pin
Christian Graus7-Jan-07 22:58
protectorChristian Graus7-Jan-07 22:58 
AnswerRe: How to access runtime methods of child form Pin
Martin#7-Jan-07 23:03
Martin#7-Jan-07 23:03 
GeneralRe: How to access runtime methods of child form Pin
vaibhavnvag7-Jan-07 23:40
vaibhavnvag7-Jan-07 23:40 
QuestionInt32 type alias problem! Pin
Duong Tien Nam7-Jan-07 15:22
Duong Tien Nam7-Jan-07 15:22 
AnswerRe: Int32 type alias problem! Pin
Judah Gabriel Himango7-Jan-07 15:34
sponsorJudah Gabriel Himango7-Jan-07 15:34 
GeneralRe: Int32 type alias problem! Pin
Duong Tien Nam7-Jan-07 15:44
Duong Tien Nam7-Jan-07 15:44 

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.