Windows Live Writer的幾種代碼外掛程式比較

來源:互聯網
上載者:User

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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.