Windows Live Writer的几种代码插件比较

1. Code Snippet to Format:

   1: HttpPost request = new HttpPost(url);  
   2: // 先封装一个 JSON 对象  
   3: JSONObject param = new JSONObject();  
   4: param.put("name", "rarnu");  
   5: param.put("password", "123456");  
   6: // 绑定到请求 Entry  
   7: StringEntity se = new StringEntity(param.toString());   
   8: request.setEntity(se);  
   9: // 发送请求  
  10: HttpResponse httpResponse = new DefaultHttpClient().execute(request);  
  11: // 得到应答的字符串,这也是一个 JSON 格式保存的数据  
  12: String retSrc = EntityUtils.toString(httpResponse.getEntity());  
  13: // 生成 JSON 对象  
  14: JSONObject result = new JSONObject( retSrc);  
  15: String token = result.get("token");  
-------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
2. Insert Code(支持少量语言):
HttpPost request = new HttpPost(url);  
// 先封装一个 JSON 对象  
JSONObject param = new JSONObject();  
param.put("name", "rarnu");  
param.put("password", "123456");  
// 绑定到请求 Entry  
StringEntity se = new StringEntity(param.toString());   
request.setEntity(se);  
// 发送请求  
HttpResponse httpResponse = new DefaultHttpClient().execute(request);  
// 得到应答的字符串,这也是一个 JSON 格式保存的数据  
String retSrc = EntityUtils.toString(httpResponse.getEntity());  
// 生成 JSON 对象  
JSONObject result = new JSONObject( retSrc);  
String token = result.get("token");  
-------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
3. Source Code Format(不能复制):
HttpPost request = new HttpPost(url);  
// 先封装一个 JSON 对象  
JSONObject param = new JSONObject();  
param.put("name", "rarnu");  
param.put("password", "123456");  
// 绑定到请求 Entry  
StringEntity se = new StringEntity(param.toString());   
request.setEntity(se);  
// 发送请求  
HttpResponse httpResponse = new DefaultHttpClient().execute(request);  
// 得到应答的字符串,这也是一个 JSON 格式保存的数据  
String retSrc = EntityUtils.toString(httpResponse.getEntity());  
// 生成 JSON 对象  
JSONObject result = new JSONObject( retSrc);  

String token = result.get("token");

-------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
4. Insert Source Code Plug-in:
HttpPost request = new HttpPost(url);  
// 先封装一个 JSON 对象  
JSONObject param = new JSONObject();  
param.put("name", "rarnu");  
param.put("password", "123456");  
// 绑定到请求 Entry  
StringEntity se = new StringEntity(param.toString());   
request.setEntity(se);  
// 发送请求  
HttpResponse httpResponse = new DefaultHttpClient().execute(request);  
// 得到应答的字符串,这也是一个 JSON 格式保存的数据  
String retSrc = EntityUtils.toString(httpResponse.getEntity());  
// 生成 JSON 对象  
JSONObject result = new JSONObject( retSrc);  
String token = result.get("token");  
-------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
5. 插入代码块(可以定制多个BLOG)
HttpPost request = new HttpPost(url);  
// 先封装一个 JSON 对象  
JSONObject param = new JSONObject();  
param.put("name", "rarnu");  
param.put("password", "123456");  
// 绑定到请求 Entry  
StringEntity se = new StringEntity(param.toString());   
request.setEntity(se);  
// 发送请求  
HttpResponse httpResponse = new DefaultHttpClient().execute(request);  
// 得到应答的字符串,这也是一个 JSON 格式保存的数据  
String retSrc = EntityUtils.toString(httpResponse.getEntity());  
// 生成 JSON 对象  
JSONObject result = new JSONObject( retSrc);  
String token = result.get("token");  
-------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------
cnblog效果(较CSDN在第4插件上有优势):
http://www.cnblogs.com/dartagnan/archive/2011/04/02/2003895.html
51CTO效果(惨不忍睹!!!)
http://dadoneo.blog.51cto.com/2908573/534096

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值