可以用代碼:
- < 用 < 取代
- > 用 > 取代
- & 用 & 取代
Public Shared Function GetTile(ByVal v_til As String) As String
Dim Tile As String = v_til
Dim v_cult As String = System.Configuration.ConfigurationSettings.AppSettings("Location").ToString()
If v_cult = "zh-CN" Then
Tile = StrConv(Tile, VbStrConv.SimplifiedChinese, 2052)
End If
Return Tile
End Function
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
Decode_lab(Me.Controls.Item(0))
End If
End Sub
Public Shared Function Decode_lab(ByVal v_control As Object) As Boolean
Dim v_cult As String = System.Configuration.ConfigurationSettings.AppSettings("Location").ToString()
If v_cult = "zh-CN" Then
Dim iii As Integer
Dim v_labt As String
Dim v_labn As String
For iii = 0 To v_control.Controls.Count - 1
v_labt = v_control.Controls.Item(iii).GetType.Name
If v_labt = "Label" Then
v_labn = v_control.Controls.Item(iii).id
Dim v_lab As Label = CType(v_control.FindControl(v_labn), Label)
v_lab.Text = StrConv(v_lab.Text, VbStrConv.SimplifiedChinese, 2052)
End If
If v_labt = "DataGrid" Then v_labn = v_control.Controls.Item(iii).id
Dim v_grd As DataGrid = CType(v_control.FindControl(v_labn), DataGrid)
Dim iv As Integer
Dim v_grdtc As TemplateColumn
Dim v_grdbc As BoundColumn
For iv = 0 To v_grd.Columns.Count - 1
If v_grd.Columns(iv).GetType.Name = "TemplateColumn" Then
v_grdtc = CType(v_grd.Columns(iv), TemplateColumn)
v_grdtc.HeaderText = StrConv(v_grdtc.HeaderText, VbStrConv.SimplifiedChinese, 2052)
End If
If v_grd.Columns(iv).GetType.Name = "BoundColumn" Then
v_grdbc = CType(v_grd.Columns(iv), BoundColumn)
v_grdbc.HeaderText = StrConv(v_grdbc.HeaderText, VbStrConv.SimplifiedChinese, 2052)
End If
Next
End If
If v_labt = "CheckBox" Then
v_labn = v_control.Controls.Item(iii).id
Dim v_chk As CheckBox = CType(v_control.FindControl(v_labn), CheckBox)
v_chk.Text = StrConv(v_chk.Text, VbStrConv.SimplifiedChinese, 2052)
End If
Next
End If
Return True
End Function