Login / Register
▼
Binary Fortress
Binary Fortress Software
CheckCentral
ClipboardFusion
CloudShow
DisplayFusion
FileSeek
HashTools
LogFusion
Notepad Replacer
Online Base64 Decoder
Online Base64 Encoder
Online JSON Formatter
ShellSend
TrayStatus
VoiceBot
WallpaperFusion
Window Inspector
More Apps...
DisplayFusion
CheckCentral
CloudShow
ClipboardFusion
FileSeek
VoiceBot
WallpaperFusion
▼
Download
Download
Change Log
Download Beta
Beta Change Log
License (EULA)
▼
Features
Features
HotKeys
Macros
Triggers
Clipboard Syncing
Clipboard Manager
Languages
Free vs Pro
Purchase
Screenshots
Apps
▼
Online
Online
Recent Items
Pinned Items
▼
Help
Help Guide
FAQ
Discussions
Contact Us
Find My License
Mailing Address
Advanced Settings
Macros
Languages
Clipboard
Fusion
WARNING: You currently have Javascript disabled!
This website will not function correctly without Javascript enabled.
Title
Message
OK
Confirm
Yes
No
Send Clipboard Contents to Pastebin
Return to ClipboardFusion Macros
Description
This macro sends the contents of your clipboard to
Pastebin as a new paste, and returns the new Pastebin URL to your clipboard for immediate pasting.
Language
C# (.Net)
Minimum Version
3.4+
Created By
Rinyre
Contributors
warthurton
Date Created
Jun 15, 2015
Date Last Modified
Nov 17, 2017
Macro Code
Copy
Select All
Toggle Line Wrapping
using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Net; using System.IO; public static class ClipboardFusionHelper { public static string ProcessText(string text) { System.Collections.Specialized.NameValueCollection Data = new System.Collections.Specialized.NameValueCollection(); Data["api_paste_name"] = "ClipboardFusion Paste"; // Defaults to 1 day, can be changed. See Pastebin API Data["api_paste_expire_date"] = "1D"; Data["api_paste_code"] = text; // 0 = public, 1 = unlisted, 2 = private Data["api_paste_private"] = "1"; Data["api_dev_key"] = "<API Key>"; Data["api_option"] = "paste"; using( WebClient wb = new WebClient() ) { byte[] bytes = wb.UploadValues( "https://pastebin.com/api/api_post.php", Data ); string response; using ( MemoryStream ms = new MemoryStream( bytes ) ) using ( StreamReader reader = new StreamReader( ms ) ) response = reader.ReadToEnd(); if ( response.StartsWith( "Bad API request" ) ) { BFS.Dialog.ShowMessageInfo("Failed to upload. Response: " + response); return text; } else { BFS.Dialog.ShowMessageInfo("Sent to Pastebin. URL in clipboard."); return response; } } } }
Copyright © 2007-2021 Binary Fortress Software
•
News
•
Discussions
•
FAQ
•
Support
•
Privacy
•
ToS
•
Get Binary Fortress Merch