[ASP.NET] 繁簡直接轉換

繁轉簡

    '''
    ''' 覆寫 Render 方法做繁轉簡的動作。
    '''
    Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)

        Dim HtmlStr As String
        Dim oStringWriter As New StringWriter()
        Dim oHtmlWriter As New HtmlTextWriter(oStringWriter)
        MyBase.Render(oHtmlWriter)
        oHtmlWriter.Flush()
        oHtmlWriter.Close()
        '取得網頁的輸出內容做繁體中文轉簡體中文的動作
        HtmlStr = StrConv(oStringWriter.ToString(), VbStrConv.SimplifiedChinese, 2052)
        Response.Write(HtmlStr)
    End Sub

簡轉繁 VbStrConv.TraditionalChinese, 2052

留言

這個網誌中的熱門文章

net use 系統發生 1219 錯誤

[MS SQL]資料庫複寫 刪除發行集 無法刪除

[Windows]密碼複雜性需求 停用密碼複雜度