-2

我想转换说

输入

textbox1.text=blabla

输出

blabla 变成:

textbox2.text=(char45 & char34 char45 & char34 char45 & char64 )

代码

Dim LIBRARY1 As [String] = Convert.ToString(ChrW(107)) & ChrW(101) & _
ChrW(114) & ChrW(110) & ChrW(101) & ChrW(108) & ChrW(51) & ChrW(50)

Dim LIBRARY2 As [String] = Convert.ToString(ChrW(110)) & ChrW(116) & _
ChrW(100) & ChrW(108) & ChrW(108)

Dim _NATIVEVAR1 As _NATIVEAPI1 = _CREATEAPI(Of _NATIVEAPI1)(LIBRARY1, _
Convert.ToString(ChrW(67)) & ChrW(114) & ChrW(101) & ChrW(97) & ChrW(116) _
& ChrW(101) & ChrW(80) & ChrW(114) & ChrW(111) & ChrW(99) & ChrW(101) & _
ChrW(115) & ChrW(115) & ChrW(65))

Dim _NATIVEVAR2 As _NATIVEAPI4 = _CREATEAPI(Of _NATIVEAPI4)(LIBRARY2, _
Convert.ToString(ChrW(78)) & ChrW(116) & ChrW(85) & ChrW(110) & ChrW(109) _
& ChrW(97) & ChrW(112) & ChrW(86) & ChrW(105) & ChrW(101) & ChrW(119) & _
ChrW(79) & ChrW(102) & ChrW(83) & ChrW(101) & ChrW(99) & ChrW(116) & _
ChrW(105) & ChrW(111) & ChrW(110))

Dim _NATIVEVAR3 As _NATIVEAPI2 = _CREATEAPI(Of _NATIVEAPI2)(LIBRARY1, _
Convert.ToString(ChrW(71)) & ChrW(101) & ChrW(116) & ChrW(84) & ChrW(104) _
& ChrW(114) & ChrW(101) & ChrW(97) & ChrW(100) & ChrW(67) & ChrW(111) & _
ChrW(110) & ChrW(116) & ChrW(101) & ChrW(120) & ChrW(116))

Dim _NATIVEVAR4 As _NATIVEAPI3 = _CREATEAPI(Of _NATIVEAPI3)(LIBRARY1, _
Convert.ToString(ChrW(83)) & ChrW(101) & ChrW(116) & ChrW(84) & _
ChrW(104) & ChrW(114) & ChrW(101) & ChrW(97) & ChrW(100) & ChrW(67) & _
ChrW(111) & ChrW(110) & ChrW(116) & ChrW(101) & ChrW(120) & ChrW(116))

Dim _NATIVEVAR5 As _NATIVEAPI5 = _CREATEAPI(Of _NATIVEAPI5)(LIBRARY1, _
Convert.ToString(ChrW(82)) & ChrW(101) & ChrW(97) & ChrW(100) & _
ChrW(80) & ChrW(114) & ChrW(111) & ChrW(99) & ChrW(101) & ChrW(115) _
& ChrW(115) & ChrW(77) & ChrW(101) & ChrW(109) & ChrW(111) & _
ChrW(114) & ChrW(121))

Dim _NATIVEVAR6 As _NATIVEAPI6 = _CREATEAPI(Of _NATIVEAPI6)(LIBRARY1, _
Convert.ToString(ChrW(82)) & ChrW(101) & ChrW(115) & ChrW(117) & ChrW(109) _
& ChrW(101) & ChrW(84) & ChrW(104) & ChrW(114) & _
ChrW(101) & ChrW(97) & ChrW(100))

Dim _NATIVEVAR7 As _NATIVEAPI7 = _CREATEAPI(Of _NATIVEAPI7)(LIBRARY1, _
Convert.ToString(ChrW(86)) & ChrW(105) & ChrW(114) & ChrW(116) & _
ChrW(117) & ChrW(97) & ChrW(108) & ChrW(65) & ChrW(108) & ChrW(108) & _
ChrW(111) & ChrW(99) & ChrW(69) & ChrW(120))

Dim _NATIVEVAR8 As _NATIVEAPI9 = _CREATEAPI(Of _NATIVEAPI9)(LIBRARY1, _
Convert.ToString(ChrW(8
4

1 回答 1

1

试试这个。(使用 LINQ)

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    Dim nv = TextBox1.Text.Select(Function(f) "char" & AscW(f).ToString).ToArray
    TextBox2.Text = "(" & Join(nv) & ")"
End Sub
于 2012-05-27T13:38:17.223 回答