webclient

System.Net.WebClient "Unable to write data to the transport connection"

I am trying to do a plain multipart form upload using System.Net.WebClient and Basic Authentication. I have had some trouble with this and have been using Fiddler2 for debugging some 401 errors I have been having with the service. I have arrived at the code below, which succeeds while Fiddler2 is running, but fails when it does not, wi...

c# send image to php script, php script loop through $_FILES array

Okay so i have code that uploads images WebClient client = new WebClient(); client.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); client.UploadFile("Address/upload.php", "POST", @"C:\Test\test.jpg"); For example, the file name will be dynamic and could be anything, so how do i send an image to server and then save ...

How do you play a sound on the web browser?

How do I play a sound on the web browser as notification? ...

Silverlight strange bug with bitmap images and WebClient

I have strange bug with showing image in silverlight. The problem to show list of images that configured in xml file and this xml downloaded from server by WebClient type. WebClient client = new WebClient(); client.AllowReadStreamBuffering = true; client.OpenReadAsync(new Uri(path, UriKind.Relative), new GalleryU...

Download HELP with WebClient in C#

Hello I am using this code to download multiple file. My problem is that it downloads them all at one time and what I want to do is have the progress bar show each file downloaded to 100% then go to the next file. I mean I want the first file to download and go to 100% in progress bar then the second one and start the progress bar again ...

Get http file size, download location, and URL in a label.

I am using this to download a file and get % info and completed info. I want to know how to get the size of the file being downloaded and the URL remote address and the local address where the file is being saved to. private void Form1_Load_1(object sender, EventArgs e) { label21.Text = "Download in progress..."; ...

Exception with WebClient.DownloadFileAsync

I am trying to download a zip file on my server by doing WebClient.DownloadFileAsync(new Uri(DownloadLink), Path.GetFileName(DownloadLink)); I have events linked to download completed and progress changed and when the download gets to 99%, it stops. So I give it a minute and then it gives me an exception: ...

Access internal field [WebClient]

I have a WebClient instance that receives data from a remote website. I referenced a DownloadProgressChanged event handler and I am trying to access InnerBuffer, which is an internal field in the DownloadBitsState nested class (set as private) in WebClient. I am using the following code right in the DownloadProgressChanged event handler...

use the WebClient class to call a webserver and read the file/directory

Please how can i use the WebClient class to call a webserver, read the file/directory lists and navigate through the directories recursively? ...

C# WebClient crashes my application!

Hi there, i'm trying to run this code: remoteProducts.ForEach(delegate(RemoteProduct p) { this.toolStripStatus.Text = "Downloading product: " + this.progress.Value + "/" + remoteProducts.Count; try { prodLocalDao.addProduct(p.Id, p.Categ...

is there a subversion web client that I can use

I want to install a svn web client on Linux (preferred) or Windows. I need only read-only capabilities (no commit required) and I want to be able to compare revisions using diff. my svn server is on another machine so the web server needs to access it over http. It should also be free... Do you know any such web client? ...

building an XDocument with a webclient downloaded string

I am using the following methods to download an xml file private void LoadXMLFile() { WebClient xmlClient = new WebClient(); xmlClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(XMLFileLoaded); xmlClient.DownloadStringAsync(new Uri("chart.xml", UriKind.RelativeOrAbsolute)); } void XMLFileLoaded(object sen...

Authenticating ASP.NET MVC user from a WPF application

Hello, How can I authenticate a user (with username and password) of an ASP.NET MVC application? I'm trying to do this using WebClient, passing NetworkCredentials, posting the request to the ASP.NET MVC application from my WPF client. How do I handle this request on the server? How do I get the passed username and password? I'm using f...

C# Login to thetvdb.com then set episode rating

I want to have my c# program automatically post ratings for an episode while logged into my tvdb account. I have done something similar many times using some code i got from http://stackoverflow.com/questions/2798610/login-to-website-and-use-cookie-to-get-source-for-another-page as a guide. Here is my version of it: public class We...

WebClient.OpenRead exception: "Value cannot be null."

I'm developing a scraper that scrapes one web page for links, then creates threads which execute scraping of subpages. This is what a thread does: Dim client As New WebClient() Dim stream As Stream = client.OpenRead(_Address) Dim streamReader As New StreamReader(stream, True) _Content = streamReader.ReadToEnd() streamReader.Close() st...

Post collection of C# objects using WebClient

I am trying to post to an ASP.NET MVC action from another Action (separate sites) and I need to post a collection of objects. I'm unable to find how to serialize this collection of objects so I can get them as a standard NameValueCollection. Example: var test1 = new TestObject { FirstName = "John", LastName="Smith", IDNum=...

synchronizing webClient download (silverlight)

so I have this function which gets called multiple times during my program. //global variable BitmapImage img; private void LoadImageFile(string ImageName) { WebClient ImageClient = new WebClient(); ImageClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(ImageFileLoaded); ...

pratical challenge: retrieving cookies from this site in .Net

Hi folks, I have a pratical question here. I have to access to a site and get the cookies information to reuse it in subsequent navigation. I don't have any browser control on my side, because everything is supposed to run on a server. With some site the task is pretty easy, but there are some site that send back cookies in a way I canno...

C# WebClient disable cache

Good day. I'm using the WebClient class in my C# application in order to download the same file every minute, and then the application performs a simple check to see if the file has been changed, and if it does do something with it. Well since this file is downloaded every minute the WebClient caching system is caching the file, and no...

Mono WebClient encoding issue

Hello: I'm trying to port a .NET application from Windows to Mono, but certain code that was working on Windows is no longer working (as expected) on mono: WebClient client = new WebClient (); Console.WriteLine (client.DownloadString("http://www.maxima.fm/51Chart/")); it seems to detect correctly the encoding as UTF-8 (and manually s...