Questions tagged [webclient]

WebClient is a class for .NET Framework applications that provides methods for sending and receiving data from a resource identified by a URI.

Read more about the WebClient class and its usage here: https://learn.microsoft.com/en-us/dotnet/api/system.net.webclient

4098 questions
1
vote
1 answer

C# WebClient running slow the first time

I'm using WebClient to download some text from a web-page, like this: WebClient wc = new WebClient(); string str = wc.DownloadString("http://blah"); Now while it works absolutely fine, one problem I am facing with it is that the first time it…
dnclem
  • 2,818
  • 15
  • 46
  • 64
1
vote
1 answer

C# webClient download does throw error

I'm trying to download a file through my application but I get an UnauthorizedAccessException yet the link is valid. What is wrong? using (WebClient webClient = new WebClient()) { …
user9373061
1
vote
1 answer

Downloading multiple files from FTP site using PowerShell

I want to download multiple files from FTP using PowerShell 5.0 with Windows 7. The script I wrote works fine for a single file but does not work for multiple files with wildcard character. Can someone please tell me what I am doing wrong? When I…
Rob
  • 11
  • 3
1
vote
1 answer

Update MailboxSettings fails with Unsupported Media Type (415)

Having negotiated the Oauth2 maze of tokens and the like, I can get the MailboxSettings from the Outlook REST API using : https://outlook.office.com/api/v2.0/me/mailboxsettings I'm now trying to update the mailboxsettings (autoreply settings)…
1
vote
0 answers

Downloading a string from a website?

I've been looking how to download a string from a PHP script which is hosted by Infinity Free. The examples I have been seeing online uses WebClient to download the string with: WebClient client = new WebClient (); string reply =…
OllieG
  • 11
  • 1
1
vote
0 answers

DownloadString return 502 bad gateway error from SSIS script task

I have a webapi from which I am getting JSON data by using WebClient DownloadString method. When I run the URL in the browser, I get the JSON response, but when I run it using SSIS package, it is failing at DownloadString call with the following…
Sam
  • 39
  • 5
1
vote
1 answer

Check for "Root Element is missing", when using XDocument.Parse?

I'd like to hear, how you check for "Root element is missing", when using XDocument.Parse(); Currently, I'm using a try-catch, to catch the error, but I'd like to hear, if any of you have a more clever way to do it - personally, I'd like to avoid…
1
vote
0 answers

Filling out radiobuttons and comboboxes via WebClient

I'm writing code using webclient to post a webpage, that fills out a few data fields using a NameValueCollection which looks something like this: WebClient client = new WebClient(); NameValueCollection values = new…
1
vote
1 answer

Problems to post data of input radio type to specific URL using WebClient

I need to use "HTTP Post" with WebClient to post some data to a specific URL. I have some problems to pass a value to input type "Radio". Partial web code:
  • NIF a seleccionar
    josmiz
    • 11
    • 2
  • 1
    vote
    0 answers

    Webclient.DownloadFileCompleted event failed

    I am downloading a large file from a web site. Size: = 599 MB (629,113,799 bytes). The program works fine. However I run into some errors: not able to validate that the file was completely donwloaded. I did not see any of the messages in the screen…
    1
    vote
    1 answer

    DownloadString works for HTTP but not for HTTPS

    I have webclient call in my SSIS package which call an API to get JSON response. using (var mySSISWebClient = new System.Net.WebClient()) { mySSISWebClient.Headers[HttpRequestHeader.Accept] =…
    1
    vote
    1 answer

    How to download html using WebClient residing on the own server?

    How do I make WebClient connect and download htm from its page. I know this is very confusing so let me retierate: I have written code using WebClient to download htm string of http://www.someserver.com/Invoice.aspx. The Webclient code resides in…
    dpak
    • 55
    • 7
    1
    vote
    1 answer

    Windows service getting stopped abruptly

    I have a windows service application which sends some message to another webservice (which intern are sent out as email) and downloads response from the server. Recently, service is getting stopped once in couple of days. (Eventough exception…
    Pramod Ray
    • 11
    • 2
    1
    vote
    2 answers

    Webview Desktop website won't work in Android

    Partly as an exercise for learning a little Android programming, and partly because I wish I had a WhatsApp client on Android mobile, I am trying to create an app that I can personally use as a WhatsApp client for my mobile. All it does is load up…
    Vignesh
    • 592
    • 6
    • 25
    1
    vote
    0 answers

    WebClient Log in website with hidden random input

    I want to login a website with WebClient. The login-form:
    knyL
    • 27
    • 1
    • 8