Click here to Skip to main content
15,867,750 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there,

I converted the project A Simple Crawler Using C# Sockets to C# 2010.

The Programm is reading information for the work from the UI Thread in the worker thread.

It is done like:
string strUri = comboBoxWeb.Text.Trim();


What do I have to do be able to run the programm in the new C# version?
Is it necessary to use an invoke?

greetings
delicious cake
Posted
Updated 16-Nov-10 21:49pm
v2
Comments
Manfred Rudolf Bihy 16-Nov-10 17:52pm    
Did you run into any problems? Did you find any issues?
Dalek Dave 17-Nov-10 3:49am    
Edited for Readability.

1 solution

Yes, thats one way of doing it

something like:
C#
static void Thread(object state)
{
   MyForm param = (MyForm)state;
   string file = string.Empty;
   param.Invoke(new MethodInvoker(delegate
   {
      string strUri = comboBoxWeb.Text.Trim();
   }));
}


don't use BeginInvoke since you need a synchronous operation
 
Share this answer
 
Comments
Dalek Dave 17-Nov-10 3:49am    
Good Call.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900