惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
B
Blog RSS Feed
云风的 BLOG
云风的 BLOG
G
Google Developers Blog
Recent Announcements
Recent Announcements
A
About on SuperTechFans
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
Google DeepMind News
Google DeepMind News
S
Schneier on Security
S
Secure Thoughts
T
The Exploit Database - CXSecurity.com
Martin Fowler
Martin Fowler
P
Proofpoint News Feed
Security Latest
Security Latest
Jina AI
Jina AI
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Recorded Future
Recorded Future
T
Tor Project blog
有赞技术团队
有赞技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
News | PayPal Newsroom
博客园 - 三生石上(FineUI控件)
MyScale Blog
MyScale Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
Forbes - Security
Forbes - Security
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
NISL@THU
NISL@THU
C
Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Google DeepMind News
Google DeepMind News
Project Zero
Project Zero
IT之家
IT之家
T
Threatpost
Cyberwarzone
Cyberwarzone
O
OpenAI News
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
J
Java Code Geeks
P
Proofpoint News Feed
The Last Watchdog
The Last Watchdog
月光博客
月光博客
Latest news
Latest news
MongoDB | Blog
MongoDB | Blog
Apple Machine Learning Research
Apple Machine Learning Research

博客园 - Kingthy

【开源项目】智能电视及电视盒子的控制应用TVRemoteIME的接口说明 实现安卓里边下边播的播放器(源码公开) 现在很火的答题赢钱游戏,让我来简单教你怎么做自动答题器 【开源项目】电视盒子好用又强大的APP: TVRemoteIME [原创]用C#实现微信“跳一跳”小游戏的自动跳跃助手 javascript图片隐写术,感觉可以用它来干点有想法的事情 我的KT库之----与VT的结合 我的KT库之----数据库的操作(DbCommandBuilder/DbConditionBuilder) VTemplate模板引擎的使用—Function标签 我的KT库之----数据库的操作(DbCommandExecutor) 我的KT库之----数据库的操作(DbHelper) 我的KT库之----数据对象 【原创】腾讯微博的XSS攻击漏洞 我的KT库之-----缓存与配置 我的KT库之-----对象池 我的KT库之-----扩展方法 我的KT库之-----认识KT 怪异的StackOverflowException异常 开源的Kingthy.Mail邮件组件库
[开源]基于C#的腾讯微博SDK V0.1版本发布
Kingthy · 2011-03-03 · via 博客园 - Kingthy

开发此SDK项目的起原

对腾讯微博真的不知道怎么说好,它里面的文档非常的乱(莫非真的像网上所说文档说明都是抄新浪的?)

想找个.NET所用的SDK,去官网的论坛下载了C#版本的SDK,却发现里面的代码也是乱且单一,使用起来非常的不方便。而网上其它第三方开发的SDK又非常的难找。所以就打算自己写一个SDK!

项目版本更新历史?

2011-03-02 V0.1

  • 实现了OAuth授权认证
  • 实现了时间线里的所有接口调用
  • 实现了微博相关的部分接口调用,如:获取某条微博数据、发表微博(不带图片)、转播、删除、回复等

2011-03-03 V0.2

  • 重新更改项目框架的划分。
  • 与微博相关的API都已实现完成,现可以发表带图片的微博信息。
  • 实现了帐户相关的所有接口调用。
  • 实现了关系链相关的所有接口调用。

SDK的使用环境?

开发环境:Visual Studio 2010

框架环境:.NET FRAMEWORK V4.0

目前的SDK实现了哪些功能接口?

  • 实现了OAuth授权认证
  • 实现了时间线里的所有接口调用
  • 实现了微博相关的部分接口调用,如:获取某条微博数据、发表微博(不带图片)、转播、删除、回复等

目前返回的数据只是以XML文本数据返回,暂未实现对象实体化处理(后续版本会实现)。

怎么使用此SDK?

1、下载项目源码编译项目取得DLL库文件或已编译的DLL库文件,将DLL库文件引用到你的项目中。

2、取得你的腾讯微博应用的APP_Key与APP_Secret,如果没有请自行前去腾讯微博开者平台申请。

3、根据APP_Key与APP_Secret实例化OAuth对象,并进入OAuth授权进程,最终取得Access Token值。

4、根据Access Token调用各种接口即可。

示例代码:(此示例代码摘自此SDK项目中的测试项目)

            OAuth oauth = new OAuth(appKey, appSecret);//获取请求Token
            if (oauth.GetRequestToken(null))
            {
                Console.WriteLine(
"获取Request Token成功。值如下:");
                Console.WriteLine(
"TokenKey={0}", oauth.Token);
                Console.WriteLine(
"TokenSecret={0}", oauth.TokenSecret);
                Console.WriteLine(
"正在请求授权, 请在授权后,将页面提示的授权码码输入下面并继续……");
                Process.Start(
"https://open.t.qq.com/cgi-bin/authorize?oauth_token=" + oauth.Token);
                Console.Write(
"授权码:");
                
string verifier = Console.ReadLine();
                
string name;
                
if (oauth.GetAccessToken(verifier, out name))
                {
                    Console.WriteLine(
"获取Access Token成功。值如下:");
                    Console.WriteLine(
"TokenKey={0}", oauth.Token);
                    Console.WriteLine(
"TokenSecret={0}", oauth.TokenSecret);
                    Console.WriteLine(
"微博帐户名={0}", name);
                }
                
else
                {
                    Console.WriteLine(
"获取Access Token时出错,错误信息: {0}", oauth.LastError);
                }
            }
            
else
            {
                Console.WriteLine(
"获取Request Token时出错,错误信息: {0}", oauth.LastError);
            }
if (oauth.LastError != null)
            {
                Console.Read();
                
return;
            }
            
string data;
            Timeline timeline 
= new Timeline(oauth);
            
//获取"冷笑话"话题相关的言论
            
//string data = timeline.GetHTTimeline(OpenTSDK.Tencent.Objects.PageFlag.First, "冷笑话", null, 10);
            
//Console.WriteLine(data);
            Twitter twitter = new Twitter(oauth);
            data 
= twitter.Delete(27523037404757);
            Console.WriteLine(data);

            TweetContent tc 

= new TweetContent("#TXOpenTSDK# 测试发带图片的微博功能.....""127.0.0.1");
            tc.Picture 
= new UploadFile(@"t.jpg");  //设置图片文件地址
            data = twitter.Add(tc);
            Console.WriteLine(data);
            Console.Read();

此SDK采用的开源协议?

采用LGPL协议,所以你可以任意使用此SDK包库文件,包括你的商业程序。但请您遵守LGPL开源协议的规定使用!

SDK的项目托管地址?

此SDK项目托管于Google Code。

URL: http://code.google.com/p/txopent/
SVN: http://txopent.googlecode.com/svn/trunk/OpenTSDK

注:此项目已停止更新,如需最新版本,请访问下面的开源项目(包含有新浪微博的接口)

http://opentsdk.codeplex.com