Skip to content

Instantly share code, notes, and snippets.

@Stanley-GF
Created December 26, 2020 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Stanley-GF/c2d06a3e9eb272eb91827557b6cee780 to your computer and use it in GitHub Desktop.
Save Stanley-GF/c2d06a3e9eb272eb91827557b6cee780 to your computer and use it in GitHub Desktop.
A simple C# method for create hastebin without using any librarys
public class Hastebin
{
public static string CreateHaste(string value)
{
WebClient
client = new WebClient();
string bruh = client.UploadString("http://hastebin.com/documents", value);
return "http://hastebin.com/" + bruh.Replace(@"\", "").Replace("/", "").Replace("key", "").Replace("{", "").Replace("}", "").Replace("\"", "");
}
}
// So call the method
public class program
{
static void Main(string[] args)
{
string myfile = Hastebin.CreateHaste("text");
Console.WriteLine(myfile);
Console.ReadKey();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment