Jump to content
Xtreme .Net Talk

Get www site ( Screen Scrapes ) faster??? -= .NET C# / VB.NET =-


Recommended Posts

Posted

Hi!!

 

I have some code that get the contant of a site and display it...

it's a windows form application....

 

but it's too slow ( BTW: my internet connection isn't slow ;) )

 

here is my code:

 

		textBox1.Text = String.Empty;

		WebClient currentWebClient = new WebClient();

		string strURL = _txtSiteUrl.Text.Trim();

		byte[] aRequestedHTML;

		aRequestedHTML = currentWebClient.DownloadData( strURL );

		UTF8Encoding currentUTF8Encoding = new UTF8Encoding();

		string strRequestedHTML;

		strRequestedHTML = currentUTF8Encoding.GetString( aRequestedHTML );

		textBox1.Text = strRequestedHTML;

 

 

the code problem is this part:

 

aRequestedHTML = currentWebClient.DownloadData( strURL );

 

 

What can I do to get a better performance?

 

 

 

 

Kind Regards,

 

gicio

  • Administrators
Posted

Does it take longer to download the page in code than it does to open in a web browser? Just because your connection is fast doesn't mean the site you are downloading from is (or the links in between are either).

Roughly home much data are you downloading and how long is it taking?

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...