Monday, December 05, 2005

Upload a file to a virtual directory using WebClient class is asp.net


string
uri=@"http://laptop/nmasp/SOMEPAGE.aspx";

string FileName=@"E:\nmasp\WebClient\Doc\Eula.RTF";

WebClient wc=new WebClient();

wc.Credentials =System.Net.CredentialCache.DefaultCredentials;

byte[] res=wc.UploadFile(uri,"post",FileName);

Response.Write(res.ToString());

Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?