我用VB的Line Input #InputFileNumber, TextLine语句从某一个文本文件中读入了一行字符,我现在想查找该字符串中是否含有二进制值为0的字符,该怎么办?
我用了以下几种InStr的用法,都不行!InStr(TextLine,Chr(0))
InStr(TextLine,Chr(&00))
InStr(TextLine,0)
InStr(TextLine,vbNullString)
InStr(TextLine,vbNullChar)那位大侠救命啊,100分倾请奉献!

解决方案 »

  1.   

    用二进制操作呀
    dim b() as byte
        Open 文件路径 For Binary As #1
        a = LOF(1)
        ReDim b(a)
        Get #1, , b()
        Close #1
    查找就是for i =0 to ubound(b)     if b(i)=0 then  XXXXXXXXXXXX '找到0了next
      

  2.   

    看看这个:Dim MyStr As String
    Dim Strs() As StringMyStr="jjjyyyuuu" & chr(0) & "PPP" & String(5,0)
    Strs=Split(MyStr,chr(0))
    If Ubound(Strs)>=1 Then
       Msgbox "字符串中存在 0,第一个位置在第 " & Len(Strs(0))+1 & " 个字符位上"
    Else
       Msgbox "字符串中没有 0。"
    End If
      

  3.   

    TalentLi(▁▂▃▄▅ 天才的我 ▆▅▄▃▂▁) ,SupermanKing(人类) ,我已经结贴了。
    给你们二位一人50分,你们收到了吗?
    我这儿怎么显示你们得分为0呢?