dim fr() as string = (看你放的東西而定 , textbox , file ? )
for a = 0 to fr.length -1
if string.mid(fr(a),0,6) = "你要判斷的字串" then
你要做的事情
end if

next

 

 

 

 

 

'宣告streamReader物件來讀文件
Dim sr As New System.IO.StreamReader("檔案文件的路徑")

While Not sr.EndOfStream
'tmp存sr讀檔一行資料的變數
Dim tmp As String = sr.ReadLine
'如果tmp字串前面是 $GPRMC
If tmp.StartsWith("$GPRMC") Then
'做你想要的事情
End If
End While
'關閉streamReader物件
sr.Close()

arrow
arrow
    全站熱搜

    JL8051 發表在 痞客邦 留言(0) 人氣()