我正在寻找一种从我的 C# 应用程序中向 paste.org 或 pastebin.com 提交帖子的方法,我知道我必须使用某种 http 帖子,但我正在寻找具体的例子..
			
			2422 次
		
2 回答
            6        
        
		
我刚刚用 C# 编写了一个简单的PasteBin 客户端。
您可以按如下方式使用它:
        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);
您可以在此页面获取您的 API 密钥(您需要登录)。
于 2011-08-02T22:22:07.483   回答