Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-tweak.git;a=commitdiff;h=5db8373b7094e3a7c9d8f5f7e09e16bad8665da2

commit 5db8373b7094e3a7c9d8f5f7e09e16bad8665da2
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Mon Nov 15 22:31:13 2010 +0100

*added draft pastbin acces

diff --git a/frugal-mono-tools/OUTILS/Outils.cs 
b/frugal-mono-tools/OUTILS/Outils.cs
index 8b89d74..8e12caf 100644
--- a/frugal-mono-tools/OUTILS/Outils.cs
+++ b/frugal-mono-tools/OUTILS/Outils.cs
@@ -23,6 +23,50 @@ namespace frugalmonotools
{
public static class Outils
{
+               public static void SendPastbin(string text)
+               {
+               try
+               {
+
+           HttpWebRequest request = (HttpWebRequest)
+               WebRequest.Create("http://frugalware.org/paste/";);
+
+           request.AllowAutoRedirect = false;
+           request.Method = "POST";
+
+           string post = "&amp;parent_pid=&amp;format=text&amp;code2=" + 
HttpUtility.UrlEncode(text) +
+                                       
"&amp;poster=FrugalTweak&amp;paste=Send&amp;expiry=m&amp;email=";
+           byte[] data = System.Text.Encoding.ASCII.GetBytes(post);
+
+           request.ContentType = "application/x-www-form-urlencoded";
+           request.ContentLength = data.Length;
+
+           Stream response = request.GetRequestStream();
+
+           response.Write(data,0,data.Length);
+
+           response.Close();
+
+           HttpWebResponse res =(HttpWebResponse) request.GetResponse();
+           res.Close();
+           // note that there is no need to hook up a StreamReader and
+           // look at the response data, since it is of no need
+
+           if (res.StatusCode == HttpStatusCode.Found)
+           {
+               Console.WriteLine(res.Headers["location"]);
+           }
+           else
+           {
+               Console.WriteLine("Error");
+           }
+
+       }
+       catch (Exception ex)
+       {
+           Console.WriteLine("Error: " + ex.Message);
+       }
+               }
public static bool ResultAsk ;
public static bool Ask(string message)
{
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to