文件读到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 = &HCEm_lngret = SendMessage(TxtMutiline.hwnd, EM_GETLINECOUNT, 0, 0) txtnumberoflines.Text = Str(m_lngret)
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
Dim a() As String Dim b As String a = Split(b, vbCrLf) MsgBox UBound(a)
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 = &HCEm_lngret = SendMessage(TxtMutiline.hwnd, EM_GETLINECOUNT, 0, 0)
txtnumberoflines.Text = Str(m_lngret)
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
Dim b As String
a = Split(b, vbCrLf)
MsgBox UBound(a)
hhjjhjhj(大头:6分
northwolves(狼行天下) :6分
online(龙卷风V2.0--再战江湖):8分