I have my program that searches IMDB for movies. Ok.
WebClient.DownloadData(TheURL); downloads the websites source code and this usually takes around 3 seconds on a good connection (more, if your internet sucks). During this download, the entire UI freezes and make me look like a bad, bad programmer. A friend told me to look into BackGround worker class.
He also said that when you create a thread you can't have that particular method recieve any parameters. Is this true? If so, I have already modified my method to have no parameters.
Could I trouble any of you to make a little example using the background worker class? Pretty please with a Victorias Secret model on top?
Grazie.
Edit: So you guys don't think I'm some sort of lazy bum, here's the method I need to have "working" in the background. It's located in the IMDBMovie.cs class, outside of Form1 class.
public string[] IMDBMovieInformation(string Query)
{
string[] MovieInformation = new string[5];
TheDataBuffer = TheWebClient.DownloadData(IMDBMovieSearch(Query));
TheWebSource = Encoding.ASCII.GetString(TheDataBuffer);
MovieInformation[0] = FindTitle(TheWebSource);
MovieInformation[1] = FindPoster(TheWebSource);
MovieInformation[2] = FindPlot(TheWebSource);
MovieInformation[3] = FindGenre(TheWebSource);
MovieInformation[4] = FindYear(TheWebSource);
return MovieInformation;
}
This post has been edited by papuccino1: 28 May 2009 - 07:05 AM

New Topic/Question
Reply



MultiQuote






|