.Net c# recipes

This is just a page where I will add snipplets of .Net c# code that I use now and then.

POST data to an URL and read results using WebClient

var webClient = new WebClient();
var values = new NameValueCollection();
values.Add("some", "value");
values.Add("some_other", "value");
var responseArray = webClient.UploadValues("http://URL", values);
var result = Encoding.ASCII.GetString(responseArray);