Click or drag to resize
PastebinCreatePaste Method
Creates a new anonymous paste. Private pastes are not allowed when pasting anonymously.

Namespace: Pastebin
Assembly: Pastebin (in Pastebin.dll) Version: 1.0
Syntax
public string CreatePaste(
	string title,
	string languageId,
	string code,
	PasteExposure exposure = PasteExposure.Public,
	PasteExpiration expiration = PasteExpiration.Never
)

Parameters

title
Type: SystemString
The title of the paste as it will appear on the page.
languageId
Type: SystemString
The the language ID of the paste's content. A full list of language IDs can be found at http://pastebin.com/api#5
code
Type: SystemString
The contents of the paste.
exposure (Optional)
Type: PastebinPasteExposure
The visibility of the paste (private, public, or unlisted).
expiration (Optional)
Type: PastebinPasteExpiration
The duration of time the paste will be available before expiring.

Return Value

Type: String
The URL for the newly created paste.
Exceptions
ExceptionCondition
WebExceptionThrown when the underlying HTTP client encounters an error.
ArgumentNullExceptionThrown when code is null.
PastebinExceptionThrown when a bad API request is made.
See Also