Questions tagged [downloadstring]

92 questions
18
votes
2 answers

How to limit the time DownloadString(url) allowed by 500 milliseconds?

I'm writing a program that when textBox1 change: URL = "http://example.com/something/"; URL += System.Web.HttpUtility.UrlEncode(textBox1.Text); s = new System.Net.WebClient().DownloadString(URL); I want limit the time DownloadString(URL) allowed by…
NoName
  • 7,940
  • 13
  • 56
  • 108
16
votes
2 answers

How can I do System.Web.Script.Serialization in C#?

How can I do this in C# modern UI ? var url = "http://ajax.googleapis.com/ajax/services/feed/load?q=http%3A%2F%2Fwww.digg.com%2Frss%2Findex.xml&v=1.0"; var wc = new WebClient(); var rawFeedData = wc.DownloadString(url); //You can use…
tovaz
  • 193
  • 1
  • 2
  • 8
12
votes
6 answers

DownloadStringAsync wait for request completion

I am using this code to retrieve an url content: private ArrayList request(string query) { ArrayList parsed_output = new ArrayList(); string url = string.Format( "http://url.com/?query={0}", Uri.EscapeDataString(query)); …
Meredith
  • 920
  • 7
  • 16
  • 31
9
votes
2 answers

Unparseable StackExchange API response

I've written a small program to analyze my profile data from the StackExchange API, but the api returns unparse-/unreadable data to me. Data received: (self downloaded using…
cramopy
  • 3,459
  • 6
  • 28
  • 42
6
votes
1 answer

WebClient DownloadString not returning anything

I want to get the source code from a Search query of Pirate Bay, I have this in my code but it doesn't return anything: WebClient webpage = new WebClient(); string source= webpage.DownloadString("http://thepiratebay.sx/search/documentary/0/99/0");
Marcelo Cantú
  • 77
  • 1
  • 1
  • 6
5
votes
2 answers

How to use WebClient without blocking UI?

Can someone point me to a tutorial or provide some sample code to call the System.Net.WebClient().DownloadString(url) method without freezing the UI while waiting for the result? I assume this would need to be done with a thread? Is there a simple…
Johnny
  • 373
  • 1
  • 6
  • 11
4
votes
1 answer

What is basic difference between UploadData and DownloadString in asp.net webclient?

I am new to webclient. I have seen some examples to POST data to a server. I am worrying which one to be used over other. Can any one please tell me what to use when? UploadData: system.net.webclient.uploaddata(uri,…
SHEKHAR SHETE
  • 5,964
  • 15
  • 85
  • 143
4
votes
3 answers

WebClient download string (a few chars page) is so slow

I am trying to download a string from an URL. Unfortunately, it is very slow. Here is my code: // One of these types for two bad solutions anyway // byte[] result = new byte[12]; // string result; using (var webClient = new…
Bartłomiej Sobieszek
  • 2,692
  • 2
  • 25
  • 40
4
votes
4 answers

C# Download data from huge list of urls

I have a huge list of web pages which display a status, which i need to check. Some urls are within the same site, another set is located on another site. Right now i'm trying to do this in a parallel way by using code like below, but i have the…
Tys
  • 3,592
  • 9
  • 49
  • 71
4
votes
2 answers

C# WebClient DownloadString returns gibberish

I am attempting to view the source of http://simpledesktops.com/browse/desktops/2012/may/17/where-the-wild-things-are/ using the code: String URL = "http://simpledesktops.com/browse/desktops/2012/may/17/where-the-wild-things-are/"; WebClient…
yasu.neko
  • 145
  • 1
  • 8
3
votes
1 answer

.net downloadstring(url) returning 503 error suddenly

I have a simple function to scrape a web page that is suddenly getting a 503 error from the following code for a specific page: try { WebClient client = new WebClient(); client.Proxy = null; string webhtml = client.DownloadString(strURL); …
nycdan
  • 2,819
  • 2
  • 21
  • 33
3
votes
1 answer

DownloadStringAsync() does not download the string asynchronously

Trying to implement downloadStringAsync() to prevent UI freezing for 10 seconds when downloading one byte of data. However, even though the download completes, it is freezing the UI just as if I used downloadString(). Here is my code: public…
Johnny
  • 373
  • 1
  • 6
  • 11
3
votes
5 answers

C# static scope issue

Using WPF and .NET 4.0. I'm downloading some data using WebClient and using DownloadStringCompletedEventHandler to fire off my DownloadCompletedCallback function upon completion. The issue I'm having is that when DownloadCompletedCallback is called…
castis
  • 8,154
  • 4
  • 41
  • 63
3
votes
1 answer

Can't use current application during using WebClient

I have trying to update some data without asking users on windows application, but when I try to download , app isn't usable and controls aren't touchable. Code: using (WebClient client = new WebClient {Encoding =…
3
votes
2 answers

Multi-language Google Translate API is returing (503) Server Unavailable

I am trying to use Google Translate to translate but it gives error Server Unavailable. What my guess is that when I try to put same thing in the address bar we receive a captcha to fill in. If we get thru the captcha than only it downloads a txt…
Mohit S
  • 13,723
  • 6
  • 34
  • 69
1
2 3 4 5 6 7