Private Sub Command1_Click()
MsgBox "d:\temp.txt" & "共有" & hangshu("d:\temp.txt") & "行!"
End Sub
Function hangshu(txtpath As String) As Long
Dim filetxt As String, x As Variant
filetxt = String(FileLen(txtpath), " ")
Open txtpath For Binary As 1
Get #1, , filetxt
Close 1
x = Split(filetxt, vbCrLf)
hangshu = UBound(x) + 1
Set x = Nothing
End Function