Hey I am trying to write a program that will upload a text file to my website and was fooling around with this code but was unable to get it to work. Is this possbile to do something like this in a C# project? When I looked around on google all i saw was C# via ASP.net to complete this task. But I am trying to go for a desktop program that will upload this text file. Any help on this matter would be greatly appricated.
WebClient Client = new WebClient();
NetworkCredential myCred = new NetworkCredential(
"username", "userpassword", "domain?");
Client.Credentials = myCred;
Client.UploadFile("website","POST", "c:\texttext.txt");
Uploading Files
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Ryan AlfordRank #1,411 · 1.2K reputationPosted Jan 31, 2008, 4:55 AM EST