比如将:%B1%C8%BF%A8%B3%AC
转换为中文有这段代码吗??
转换为中文有这段代码吗??
解决方案 »
- split和下标越界问题
- 做个控件 跟 Combobox 一样
- 帮忙写一段不准使用某一执行文件的代码
- 求高当前好用VB皮肤软件
- 请问使用API的Lineto函数画的线用什么方法可以擦除?
- 在一个Picturebox控件中放一个Label控件当label的字体改变时要使label自动在Picturebox中自动居中
- 我在计算机无人使用情况下,怎么知道事先运行的软件死没死啊?
- 为什么vb提示找不到方法或数据成员
- 实时错误‘3426’该操作被关联对象取消 怎么解决?
- 谁能清除数据库日志SQL Server
- 谁会在VB中调用mpglib.dll
- 用winsock通过http POST方式向服务器上传文件的问题
Public Function ascg(smsg As String) As String
Dim si, sb As Integer
Dim stmp As Integer
Dim stemp As String
sb = Len(smsg)
ascg = ""
For si = 1 To sb
stmp = AscW(Mid(smsg, si, 1))
If Abs(stmp) < 127 Then
stemp = "00" & Hex(stmp)
Else
stemp = Hex(stmp)
End If
ascg = ascg & stemp
Next si
ascg = Trim(ascg)
End Function
'GetWindowTextA' 指明这是一个非 Unicode API 以下是修改后的 API 声明: Declare Function GetWindowText Lib "user32" Alias "GetWindowTextW" (ByVal hwnd As Long, ByVal lpString As Long, ByVal cch As Long) As Long
'GetWindowTextW' 指明这是一个 Unicode API 由此可见,修改一个非 Unicode API 成为一个 Unicode API 的要点是:
* 把 Alias 里函数名的结尾 'A' 换成 'W'。
* 把所有 ByVal *** As String ,改为 ByVal *** As Long 。
dim a() as string, b() as byte, i as long
a = split(trim(s),"%")
redim b(ubound(a))
for i=0 to ubound(a)
b(i) = cbyte("&H" & a(i))
next
Decode = StrConv(b, vbUnicode)
end function
'== Immediate ==
?Decode("%B1%C8%BF%A8%B3%AC")
比卡超