WebClient Client = new WebClient (); Client.DownloadFile("http://www.csharpfriends.com/Members/index.aspx", " index.aspx");
WebClient Client = new WebClient (); Stream strm = Client.OpenRead ("http://www.csharpfriends.com/Members/index.aspx");
public form1() { InitializeComponent(); System.Net.WebClient Client = new WebClient(); Stream strm = Client.OpenRead("http://www.csharpfriends.com"); StreamReader sr = new StreamReader(strm); string line; do { line = sr.ReadLine(); listbox1.Items.Add(line); } while (line !=null); strm.Close(); }
WebClient Client = new WebClient(); Client.UploadFile("http://www.csharpfriends.com/Members/index.aspx", "c:\wesiteFiles\newfile.aspx"); byte [] image; //code to initialise image so it contains all the binary data for some jpg file client.UploadData("http://www.csharpfriends.com/Members/images/logocc.jpg", image);
Build Your Own ASP.NET Website Using C# & VB.NET