1.Windows Live Writer的设置
- 安装Windows Live Writer的插件的SyntaxHighlighter。
- 更新博客的风格。 你可以更新菜单中的“博客”的风格 - “编辑博客设置...” 和“编辑”选项卡。
2. 如何插入代码
效果如果下:
1
public
static
ArrayList
<
HashMap
<
String,
Object
>
>
formatContent(String[][]
goods)
{
2
3 ArrayList < HashMap < String, Object > > list = new ArrayList < HashMap < String, Object > > ();
4 HashMap < String, Object > map = new HashMap < String, Object > ();
5
6
7 for ( int i = 0 ; i < goods . length ; i + + ) {
8
9 /* operation 转int */
10
11 int operation = Integer . parseInt(goods[i][ 0 ]);
12 map . put( " OPERATION " , operation);
13
14 /* tob_code 去空格 */
15 String tob_code = new String(goods[i][ 1 ] . replaceAll( " //s+$ " , " " ));
16 System . out . println( " tob_code: " + tob_code);
17 map . put( " TOB_CODE " , tob_code);
18
19 /* tobname 去空格 */
20 String tobname = new String(goods[i][ 2 ] . replaceAll( " //s+$ " , " " ));
21 System . out . println( " tobname: " + tobname);
22 map . put( " TOBNAME " , tobname);
23
24 /* simplecode 去空格 */
25 String simplecode = new String(goods[i][ 3 ] . replaceAll( " //s+$ " , " " ));
26 System . out . println( " simplecode: " + simplecode);
27 map . put( " SIMPLECODE " , simplecode);
28
29 /* shortcode 去空格 */
30 String shortcode = new String(goods[i][ 4 ] . replaceAll( " //s+$ " , " " ));
31 System . out . println( " shortcode: " + shortcode);
32 map . put( " SHORTCODE " , shortcode);
33
34
35 /* manufacture 去空格 */
36 String manufacture = new String(goods[i][ 5 ] . replaceAll( " //s+$ " , " " ));
37 System . out . println( " manufacture: " + manufacture);
38 map . put( " MANUFACTURE " , manufacture);
39
40 /* unitid */
41 String unitid = new String(goods[i][ 6 ] . replaceAll( " //s+$ " , " " ));
42 System . out . println( " unitid: " + unitid);
43 map . put( " UNITID " , unitid);
44
45 /* unitcode */
46 String unitcode = new String(goods[i][ 7 ] . replaceAll( " //s+$ " , " " ));
47 System . out . println( " unitcode: " + unitcode);
48 map . put( " UNITCODE " , unitcode);
49
50 /* bigunitid */
51 String bigunitid = new String(goods[i][ 8 ] . replaceAll( " //s+$ " , " " ));
52 System . out . println( " bigunitid: " + bigunitid);
53 map . put( " BIGUNITID " , bigunitid);
54
55 /* bigcode */
56 String bigcode = new String(goods[i][ 9 ] . replaceAll( " //s+$ " , " " ));
57 System . out . println( " bigcode: " + bigcode);
58 map . put( " BIGCODE " , bigcode);
59 /* bigscale 转 int */
60
61 int bigscale = Integer . parseInt(goods[i][ 10 ]);
62 System . out . println( " bigscale: " + bigscale);
63 map . put( " BIGSCALE " , bigscale);
64
65 /* smalunitid */
66 String smalunitid = new String(goods[i][ 11 ] . replaceAll( " //s+$ " , " " ));
67 System . out . println( " smalunitid: " + smalunitid);
68 map . put( " SMALUNITID " , smalunitid);
69
70 /* smalcode */
71 String smalcode = new String(goods[i][ 12 ] . replaceAll( " //s+$ " , " " ));
72 System . out . println( " smalcode: " + smalcode);
73 map . put( " SMALCODE " , smalcode);
74
75 /* smalscale 转int */
76
77 int smalscale = Integer . parseInt(goods[i][ 13 ]);
78 System . out . println( " smalscale: " + smalscale);
79 map . put( " SMALSCALE " , smalscale);
80
81 /* inprice 转int */
82
83 int inprice = Integer . parseInt(goods[i][ 14 ]);
84 System . out . println( " inprice: " + inprice);
85 map . put( " INPRICE " , inprice);
86
87 /* outprice 转int */
88 int outprice = Integer . parseInt(goods[i][ 15 ]);
89 System . out . println( " outprice: " + outprice);
90 map . put( " OUTPRICE " , outprice);
91
92 /* orderunitid 转int */
93 int orderunitid = Integer . parseInt(goods[i][ 16 ]);
94 System . out . println( " orderunitid: " + orderunitid);
95 map . put( " ORDERUNITID " , orderunitid);
96 /* aclass */
97 String aclass = new String(goods[i][ 17 ] . replaceAll( " //s+$ " , " " ));
98 System . out . println( " aclass: " + aclass);
99 map . put( " ACLASS " , aclass);
100
101 /* logo */
102 String logo = new String(goods[i][ 18 ] . replaceAll( " //s+$ " , " " ));
103 System . out . println( " logo: " + logo);
104 map . put( " LOGO " , logo);
105
106 /* salespromotion */
107 String salespromotion = new String(goods[i][ 19 ] . replaceAll( " //s+$ " , " " ));
108 System . out . println( " salespromotion: " + salespromotion);
109 map . put( " SALESPROMOTION " , salespromotion);
110
111 /* type 转int */
112 int type = Integer . parseInt(goods[i][ 20 ]);
113 System . out . println( " type: " + type);
114 map . put( " TYPE " , type);
115
116 list . add(map);
117
118 }
119
120
121
122
123
124
125 return list;
126
127 // HashMap
128 }
2
3 ArrayList < HashMap < String, Object > > list = new ArrayList < HashMap < String, Object > > ();
4 HashMap < String, Object > map = new HashMap < String, Object > ();
5
6
7 for ( int i = 0 ; i < goods . length ; i + + ) {
8
9 /* operation 转int */
10
11 int operation = Integer . parseInt(goods[i][ 0 ]);
12 map . put( " OPERATION " , operation);
13
14 /* tob_code 去空格 */
15 String tob_code = new String(goods[i][ 1 ] . replaceAll( " //s+$ " , " " ));
16 System . out . println( " tob_code: " + tob_code);
17 map . put( " TOB_CODE " , tob_code);
18
19 /* tobname 去空格 */
20 String tobname = new String(goods[i][ 2 ] . replaceAll( " //s+$ " , " " ));
21 System . out . println( " tobname: " + tobname);
22 map . put( " TOBNAME " , tobname);
23
24 /* simplecode 去空格 */
25 String simplecode = new String(goods[i][ 3 ] . replaceAll( " //s+$ " , " " ));
26 System . out . println( " simplecode: " + simplecode);
27 map . put( " SIMPLECODE " , simplecode);
28
29 /* shortcode 去空格 */
30 String shortcode = new String(goods[i][ 4 ] . replaceAll( " //s+$ " , " " ));
31 System . out . println( " shortcode: " + shortcode);
32 map . put( " SHORTCODE " , shortcode);
33
34
35 /* manufacture 去空格 */
36 String manufacture = new String(goods[i][ 5 ] . replaceAll( " //s+$ " , " " ));
37 System . out . println( " manufacture: " + manufacture);
38 map . put( " MANUFACTURE " , manufacture);
39
40 /* unitid */
41 String unitid = new String(goods[i][ 6 ] . replaceAll( " //s+$ " , " " ));
42 System . out . println( " unitid: " + unitid);
43 map . put( " UNITID " , unitid);
44
45 /* unitcode */
46 String unitcode = new String(goods[i][ 7 ] . replaceAll( " //s+$ " , " " ));
47 System . out . println( " unitcode: " + unitcode);
48 map . put( " UNITCODE " , unitcode);
49
50 /* bigunitid */
51 String bigunitid = new String(goods[i][ 8 ] . replaceAll( " //s+$ " , " " ));
52 System . out . println( " bigunitid: " + bigunitid);
53 map . put( " BIGUNITID " , bigunitid);
54
55 /* bigcode */
56 String bigcode = new String(goods[i][ 9 ] . replaceAll( " //s+$ " , " " ));
57 System . out . println( " bigcode: " + bigcode);
58 map . put( " BIGCODE " , bigcode);
59 /* bigscale 转 int */
60
61 int bigscale = Integer . parseInt(goods[i][ 10 ]);
62 System . out . println( " bigscale: " + bigscale);
63 map . put( " BIGSCALE " , bigscale);
64
65 /* smalunitid */
66 String smalunitid = new String(goods[i][ 11 ] . replaceAll( " //s+$ " , " " ));
67 System . out . println( " smalunitid: " + smalunitid);
68 map . put( " SMALUNITID " , smalunitid);
69
70 /* smalcode */
71 String smalcode = new String(goods[i][ 12 ] . replaceAll( " //s+$ " , " " ));
72 System . out . println( " smalcode: " + smalcode);
73 map . put( " SMALCODE " , smalcode);
74
75 /* smalscale 转int */
76
77 int smalscale = Integer . parseInt(goods[i][ 13 ]);
78 System . out . println( " smalscale: " + smalscale);
79 map . put( " SMALSCALE " , smalscale);
80
81 /* inprice 转int */
82
83 int inprice = Integer . parseInt(goods[i][ 14 ]);
84 System . out . println( " inprice: " + inprice);
85 map . put( " INPRICE " , inprice);
86
87 /* outprice 转int */
88 int outprice = Integer . parseInt(goods[i][ 15 ]);
89 System . out . println( " outprice: " + outprice);
90 map . put( " OUTPRICE " , outprice);
91
92 /* orderunitid 转int */
93 int orderunitid = Integer . parseInt(goods[i][ 16 ]);
94 System . out . println( " orderunitid: " + orderunitid);
95 map . put( " ORDERUNITID " , orderunitid);
96 /* aclass */
97 String aclass = new String(goods[i][ 17 ] . replaceAll( " //s+$ " , " " ));
98 System . out . println( " aclass: " + aclass);
99 map . put( " ACLASS " , aclass);
100
101 /* logo */
102 String logo = new String(goods[i][ 18 ] . replaceAll( " //s+$ " , " " ));
103 System . out . println( " logo: " + logo);
104 map . put( " LOGO " , logo);
105
106 /* salespromotion */
107 String salespromotion = new String(goods[i][ 19 ] . replaceAll( " //s+$ " , " " ));
108 System . out . println( " salespromotion: " + salespromotion);
109 map . put( " SALESPROMOTION " , salespromotion);
110
111 /* type 转int */
112 int type = Integer . parseInt(goods[i][ 20 ]);
113 System . out . println( " type: " + type);
114 map . put( " TYPE " , type);
115
116 list . add(map);
117
118 }
119
120
121
122
123
124
125 return list;
126
127 // HashMap
128 }
开源项目:
Project Description
SyntaxHighlighter for Windows Live Writer is a plugin that inserts code with tags for SyntaxHighlighter. This plugin includes resource of ja-JP(Japan language).
Screenshots
Insert window:



1002

被折叠的 条评论
为什么被折叠?



