VB不使用 API,将 Utf8 转换为 Unicode
Private Function Utf8ToUni(B() As Byte) As String
'不使用 API,将 Utf8 转换为 Unicode
Dim BU As Long
On Error Resume Next
BU = -1: BU = UBound(B)
If BU = -1 Then Exit Function
On Error GoTo 0
Dim I As Long, K As Long, N As Long
Dim B1 As Byte, cnt As Byte
I = LBound(B)
If BU > I + 1 Then
If B(I) = 239 And B(I + 1) = 187 And B(I + 2) = 191 Then I = I + 3 '去掉前三个字符
End If
Do
If I > BU Then Exit Do
B1 = B(I)
If (B1 And &HFC) = &HFC Then
cnt = 6
ElseIf (B1 And &HF8) = &HF8 Then
cnt = 5
ElseIf (B1 And &HF0) = &HF0 Then
cnt = 4
ElseIf (B1 And &HE0) = &HE0 Then
cnt = 3
ElseIf (B1 And &HC0) = &HC0 Then
cnt = 2
Else
cnt = 1
End If
If I + cnt - 1 > BU Then Utf8ToUni = Utf8ToUni & "?": Exit Do
Select Case cnt
Case 2: N = B1 And &H1F
Case 3: N = B1 And &HF
Case 4: N = B1 And &
相关文档:
做个mp3播放器,用realplay和WMP做出来的程序内存占用太大。
如果你仅仅是播放MP3,建议使用API函数mciSendString。
Option Explicit
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal
lpstrReturnString As String, ByVal uReturnLength As Lo ......
Dim FirstFile As String
Dim SecondFile As String
Dim FinalFile As String
Dim first() As Byte
Dim second() As Byte
Dim file1size As Long, file2size As Long
Private Sub Command3_Click()
SecondFile = Text2.Text
FirstFile = Text1.Text
FinalFile = Text3.Text
Open FirstFile For Binary Access Rea ......
'工程-->引用 添加 Microsoft activex data objects 2.5 library
'工程-->部件 添加 Microsoft flexgrid control 6.0
Dim Cnn As New ADODB.Connection
Cnn.ConnectionString = "Provider=microsoft.jet.oledb.4.0;data source=E:\Access ......
上午:
VB总结:
下图是用mindmanager制作的VB总结mdb:
常用控件的分类:
属性和过程:
方法和过程
事件过程、Function过程和过程:
VB总结大图:
分歧如下:
数据包括:数据类型、变量、常量、运算符、表达式等几部分,而流程控制语句应不应该加入其中。
我感觉不应该,用“冰块模子&rdquo ......