急!请问怎样快速计算一文本文件的行数??

xsnowboy 2004-08-15 11:00:25
急!请问怎样快速计算一文本文件的行数??多谢!
...全文
337 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xsnowboy 2004-08-16
  • 打赏
  • 举报
回复
谢谢了,只是看不明白,要是要解释就好了
hhjjhjhj(大头:6分
northwolves(狼行天下) :6分
online(龙卷风V2.0--再战江湖):8分
hhjjhjhj 2004-08-15
  • 打赏
  • 举报
回复
MsgBox CreateObject("scripting.filesystemobject").OpenTextFile("C:\aaa.txt", 8).Line
laisiwei 2004-08-15
  • 打赏
  • 举报
回复
Dim a() As String
Dim b As String
a = Split(b, vbCrLf)
MsgBox UBound(a)
northwolves 2004-08-15
  • 打赏
  • 举报
回复
Private Sub Command1_Click()
Dim arrBytes() As Byte
Open "c:\aaa.txt" For Binary As 1
ReDim arrBytes(1 To LOF(1))
Get 1, , arrBytes
Close 1
MsgBox UBound(Split(StrConv(arrBytes, vbUnicode), vbCrLf))
Erase arrBytes
End Sub
online 2004-08-15
  • 打赏
  • 举报
回复
文件读到Text中
Option Explicit
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const EM_GETLINE = &HC4
Public Const EM_GETLINECOUNT = &HBA
Public Const EM_GETFIRSTVISIBLELINE = &HCE

m_lngret = SendMessage(TxtMutiline.hwnd, EM_GETLINECOUNT, 0, 0)
txtnumberoflines.Text = Str(m_lngret)

7,759

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧