[VB.NET]VB的vbFromUnicode、vbUnicode在vb.net中怎么使用


VB的vbFromUnicode、vbUnicode在vb.net中怎么使用
VB的vbFromUnicode、vbUnicode在vb.net中没有对应的用法,下面的代码怎么转换:

Dim CompName As String * 32
Dim CompName_w As String * 16
Dim e_MyCompName As String
CompName_w = MidB(StrConv(CompName, vbFromUnicode), 1, Len(CompName_w))
e_MyCompName = RTrim(Replace(StrConv(CompName_w, vbUnicode), Chr(0), " "))

谢谢。
__________________________________________________________________________
Dim CompName As New String( " ", 64)
Dim CompName_w As New String( " ", 32)
Dim e_MyCompName As String
CompName_w = StrConv(CompName, 128).Substring(0, Len(CompName_w))
e_MyCompName = RTrim(Replace(StrConv(CompName_w, 64), Chr(0), " "))
__________________________________________________________________________
糟了,我把长度增加了一倍。
__________________________________________________________________________
改了,

Dim CompName As New String( " ", 32)
Dim CompName_w As New String( " ", 16)
Dim e_MyCompName As String
CompName_w = StrConv(CompName, 128).Substring(0, Len(CompName_w))
e_MyCompName = Replace(StrConv(CompName_w, 64), Chr(0), " ").TrimEnd
__________________________________________________________________________
上面方法跑起来会出错
__________________________________________________________________________

你可能感兴趣的:([VB.NET论坛])