比如GGG.TXT中:
有我们应当认识到自然灾害不只是降临在哪一个国家的问题,而是人类共同的敌人,是人类发展面临的共同挑战,我们都有义务去迎接这种挑战。我想查找“哪一个”
应该如何编程?
谢了。

解决方案 »

  1.   

    Private Sub Command1_Click()
        Dim strTemp As String, fPath As String, strFind As String, intPos As Long
        fPath = App.path & "\GGG.txt"
        strTemp = Space(FileLen(fPath))
        Open fPath For Binary As #1 Len = FileLen(fPath)
        Get #1, 1, strTemp
        Close #1
        
        strFind = "哪一个"
        intPos = InStr(strTemp, strFind)
        If intPos <> 0 Then
            MsgBox Chr(34) & strFind & """的位置在" & intPos
        Else
            MsgBox Chr(34) & strFind & """ 没找到!"
        End If
    End Sub