1
using System;
2
using System.Collections.Generic;
3
using System.Text;
4
using System.IO;
5
6
/// <summary>
7
/// CG2BFilter 執行簡體和繁體中文之間的轉換工作,頁頁調用時只雖在頁面加入如下代碼即可
8
/// Response.Filter = new CG2BFilter(Response.Filter);
9
/// lancy@2007.1.21
10
/// </summary>
11
public class CG2BFilter : Stream
12
{
13
Stream responseStream;
14
long position;
15
StringBuilder responseHtml;
16
/// <summary>
17
/// 繁體轉簡體
18
/// </summary>
19
/// <param name="inputStream"></param>
20
public CG2BFilter(Stream inputStream)
21
{
22
responseStream = inputStream;
23
responseHtml = new StringBuilder();
24
25
}
26
public CG2BFilter()
27
{
28
29
30
}
31
32
Filter overrides
84
85
转换任务
107
自定义函数
128
129
}
using System;2
using System.Collections.Generic;3
using System.Text;4
using System.IO;5

6
/// <summary>7
/// CG2BFilter 執行簡體和繁體中文之間的轉換工作,頁頁調用時只雖在頁面加入如下代碼即可8
/// Response.Filter = new CG2BFilter(Response.Filter);9
/// lancy@2007.1.2110
/// </summary>11
public class CG2BFilter : Stream12
{13
Stream responseStream;14
long position;15
StringBuilder responseHtml;16
/// <summary>17
/// 繁體轉簡體18
/// </summary>19
/// <param name="inputStream"></param>20
public CG2BFilter(Stream inputStream)21
{22
responseStream = inputStream;23
responseHtml = new StringBuilder();24

25
}26
public CG2BFilter()27
{28
29

30
}31

32
Filter overrides84

85
转换任务107
自定义函数128

129
}在需要转换的页面中引用:
if (Request.UserLanguages[0].ToLower() != "zh-tw")
{
Response.Filter = new WinttonPublic.CG2BFilter(Response.Filter);
}

浙公网安备 33010602011771号