所以只好自己寫一個小 Function 直接轉換,
利用一次讀入文字檔,再以跳行符號做分割,
取得分割後的陣列大小,就是檔案總行數啦!
''' <summary>
''' 取得文字檔內容的總行數
''' </summary>
''' <param name="strFilePath">要取得總行數的檔案路徑和檔名</param>
''' <returns>傳回總行數(Integer)</returns>
''' <remarks></remarks>
Private Function GetFileLine(ByVal strFilePath As String) As Integer
Dim strSplit() As String
Dim sr As StreamReader = New StreamReader(strFilePath)
Dim fileCnt As String = sr.ReadToEnd()
sr.Close()
strSplit = Split(fileCnt , vbCrLf)
Return strSplit.GetUpperBound(0)
End Function