Click here to Skip to main content
16,021,041 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have written code to crawling a shoping website let's say www.xyz.com.

in that code i wrote a method name GetData(string url) and i called it in a thread as following :

C#
Thread th=new Thread(new ThreadStart(()=>GetData));
th.start();
th.join();

upto some moment its running perfect but i don't know it's giving me message "Internet Explorer Cann't display the web page" On IE..

To get the detail i put my thread code inside try and catch(Exception ex) but nothing happens in catch... So i thought may be if i craete a log file to trace the progress ,helps me to find what's the problem... I googled for writing log file for thread but not get any solution.. need help to achive this or pls provide some solution for my problem

Thank you........
Posted

1 solution

To start with, the code you show totally defeats the purpose of threading, because you start and join the thread immediately. It means that you wait until the thread is complete, which is equivalent to making all the job in the same thread. Using the thread only would make this work slower. Using it makes no sense at all.

(And, as this is only one thread, writing the logs problem does not even exist. :-))

—SA
 
Share this answer
 
Comments
Anjanee Kumar Singh 13-Aug-13 0:34am    
Mr. Sergey Alexandrovich Kryukov
Thank you for this fruitful knowledge..But if this the case is there any another solution....If thread has some error..

if possible i also need some ssistance for this url too
http://www.codeproject.com/Questions/635820/Unable-to-read-data-from-the-transport-connection
Sergey Alexandrovich Kryukov 13-Aug-13 1:42am    
Another solution for what? You should be more specific.
—SA
Sergey Alexandrovich Kryukov 13-Aug-13 1:44am    
And how this problem is related to the problem "Unable to read data from the transport connection: The connection was closed"?
—SA

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