Mega Code Archive

 
Categories / C# Tutorial / Network
 

OpenWrite Test

using System; using System.IO; using System.Net; class MainClass {    public static void Main(string[] argv)    {       WebClient wc = new WebClient();       string data = "Data up upload to server";       Stream strm = wc.OpenWrite("http://www.rntsoft.com");       StreamWriter sw = new StreamWriter(strm);       sw.WriteLine(data);       sw.Close();       strm.Close();    } }