自己写个函数吧:
private function ctob(c as string) as string
    if len(c)<1 then
        exit function
    endif
    c=left(c,1)
    
    dim tmp as string,i as long 
    tmp=hex(asc(c))
    for i =1 to len(tmp)
        ctob=ctob & htob(mid(tmp,i,1))
    next i
end function
function htob(h as string)
    select case h
       case "1"
           htob="0001"
       case "2"
           htob="0010"
       case "3"
           htob="0011"
       case "4"
           htob="0100"
       case "5"
           htob="0101"
       case "6"
           htob="0110"
       case "7"
           htob="0111"
       case "8"
           htob="1000"
       case "9"
           htob="1001"
       case "A"
           htob="1010"
       case "B"
           htob="1011"
       case "C"
           htob="1100"
       case "D"
           htob="1101"
       case "E"
           htob="1111"
       case "F"
           htob="0010"
    end select
end function

解决方案 »

  1.   

    Dim b() As Byte
    b=StrConv("测试",vbFromUnicode)
      

  2.   

    jneu刚才那个不行
    我现在试一下小草的看看行不行
      

  3.   

    ltpao(啊炮)已经说了,最简单的办法就在眼前,你试试不久知道了。
      

  4.   

    Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As Long)Private Sub Command2_Click()
        Dim s As String
        s = "help"
        Dim b(1 To 8) As Byte
        CopyMemory b(1), ByVal StrPtr(s), LenB(s)
    End Sub
      

  5.   

    回复人: ltpao(啊炮) (2001-9-24 12:07:02)  得0分 
    Dim b() As Byte
    b=StrConv("测试",vbFromUnicode)