Torna al Thread

void Destroy_Friend(string us, string username, string password) { try { // encode the username/password string user = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(username + ":" + password)); // connect with the destroy page HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://twitter.com/friendships/destroy/" + us + ".xml"); // set the method to DELETE request.Method = "DELETE"; request.ServicePoint.Expect100Continue = true; // set the authorisation levels request.Headers.Add("Authorization", "Basic " + user); request.ContentType = "application/x-www-form-urlencoded"; WebResponse r = request.GetResponse(); r.Close(); } catch {/* DO NOTHING */} }
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5