需要imports Microsoft.VisualBasic
Public Enum LanguageTo
SimplifiedChinese = VbStrConv.SimplifiedChinese
TraditionnalChinese = VbStrConv.TraditionalChinese
End Enum
''' <summary>
''' 語言轉化方法(可以將語言轉化成繁體中文或簡體中文)
''' </summary>
''' <param name="inputStr">輸入的字符串</param>
''' <param name="TargetLanguage">要轉化的目標語言</param>
''' <returns></returns>
''' <remarks></remarks>
Public Function StrConv(ByVal inputStr As String, ByVal TargetLanguage As LanguageTo) As String
Dim str As String = String.Empty
str = Strings.StrConv(inputStr, TargetLanguage, 1033) '使用1033作為LocalID,可以處理所有的非Assic字符
Return str
End Function
SimplifiedChinese = VbStrConv.SimplifiedChinese
TraditionnalChinese = VbStrConv.TraditionalChinese
End Enum
''' <summary>
''' 語言轉化方法(可以將語言轉化成繁體中文或簡體中文)
''' </summary>
''' <param name="inputStr">輸入的字符串</param>
''' <param name="TargetLanguage">要轉化的目標語言</param>
''' <returns></returns>
''' <remarks></remarks>
Public Function StrConv(ByVal inputStr As String, ByVal TargetLanguage As LanguageTo) As String
Dim str As String = String.Empty
str = Strings.StrConv(inputStr, TargetLanguage, 1033) '使用1033作為LocalID,可以處理所有的非Assic字符
Return str
End Function