我正在寻找一种方法向我的C#应用程序中的pastie.org或者pastebin.com提交帖子,我知道不得不使用某种http帖子,但我正在寻找具体的例子..
答案 0 :(得分:2)
我刚写了一个简单的PasteBin client in C#。
您可以按如下方式使用它:
string apiKey = "<your api key>";
var client = new PasteBinClient(apiKey);
// Optional; will publish as a guest if not logged in
client.Login(userName, password);
var entry = new PasteBinEntry
{
Title = "PasteBin client test",
Text = "Console.WriteLine(\"Hello PasteBin\");",
Expiration = PasteBinExpiration.OneDay,
Private = true,
Format = "csharp"
};
string pasteUrl = client.Paste(entry);
Console.WriteLine("Your paste is published at this URL: " + pasteUrl);
您可以在this page上获取API密钥(您需要登录)。
答案 1 :(得分:0)