Windows Live Writer 是個挺不錯的日誌書寫工具,但對於代碼問題比較頭痛,在網上搜了一些代碼外掛程式,現推薦幾款比較好用的外掛程式
1.Insert Code for Windows Live Writer
效果是這樣子的:
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace WebApplication1{ public partial class TestIP : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string IP = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (string.IsNullOrEmpty(IP)) { //沒有代理IP則直接取用戶端IP IP = Request.ServerVariables["REMOTE_ADDR"]; } } }}
評:沒有明顯的邊框,但看起來比較清爽。
:http://gallery.live.com/liveItemDetail.aspx?li=1f57bd9b-a692-4593-9e9e-e2962d9c0eee&bt=9&pl=8
2.Code Snippet Plugin
效果:
1: using System;
2: using System.Collections.Generic;
3: using System.Linq;
4: using System.Web;
5: using System.Web.UI;
6: using System.Web.UI.WebControls;
7:
8: namespace WebApplication1
9: {
10: public partial class TestIP : System.Web.UI.Page
11: {
12: protected void Page_Load(object sender, EventArgs e)
13: {
14: string IP = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
15: if (string.IsNullOrEmpty(IP))
16: {
17: //沒有代理IP則直接取用戶端IP
18: IP = Request.ServerVariables["REMOTE_ADDR"];
19: }
20: }
21: }
22: }
評:有明顯的邊框與底色,代碼挺突出挺漂亮
:http://www.box.net/shared/j14u8rtm6g
3.CodePaste Plugin For Windows Live Writer
效果:
隱藏行號 複製代碼 ? 這是一段程式碼。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
public partial class TestIP : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string IP = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (string.IsNullOrEmpty(IP))
{
//沒有代理IP則直接取用戶端IP
IP = Request.ServerVariables["REMOTE_ADDR"];
}
}
}
}
評:複製代碼後,插入-》粘貼原始碼 就完成了,方便,也挺美觀
:http://public.blu.livefilestore.com/y1ps6diGhJIvBML_030iJ_wpGw0iitdKsIsvP5qv5U9HhAoSqH_2DqxEPkQ7NVZGDJMTuT-LhivnXd73x9MIKkw9w/CodePaste-v1.0.3345.rar?download
4.Highlight4Writer
效果:
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace WebApplication1{ public partial class TestIP : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string IP = Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (string.IsNullOrEmpty(IP)) { //中文亂碼了
IP = Request.ServerVariables["REMOTE_ADDR"]; } } }}評:非常不錯,不過要下中文版的,英文版的中文會出現亂碼,除非你英語水平還可以的話,那也就無所謂了。
:http://www.codeplex.com/wikipage?ProjectName=Highlight4Writer