Private Sub form_load()Dim s As Integer,k As String,BB() As ByteDim FileName As String,rad() As StringFileName = "e:\频率.txt"If Dir(FileName) = "" Then Exit Subs = FreeFileReDim BB(FileLen(FileName) - 1)Open FileName For Binary As #sGet #s,,BBClos
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/18 02:41:40
Private Sub form_load()Dim s As Integer,k As String,BB() As ByteDim FileName As String,rad() As StringFileName = "e:\频率.txt"If Dir(FileName) = "" Then Exit Subs = FreeFileReDim BB(FileLen(FileName) - 1)Open FileName For Binary As #sGet #s,,BBClos
Private Sub form_load()
Dim s As Integer,k As String,BB() As Byte
Dim FileName As String,rad() As String
FileName = "e:\频率.txt"
If Dir(FileName) = "" Then Exit Sub
s = FreeFile
ReDim BB(FileLen(FileName) - 1)
Open FileName For Binary As #s
Get #s,,BB
Close #s
k = StrConv(BB,vbUnicode)
rad() = split(k,vbNewLine)
End Sub
Private Sub form_load()Dim s As Integer,k As String,BB() As ByteDim FileName As String,rad() As StringFileName = "e:\频率.txt"If Dir(FileName) = "" Then Exit Subs = FreeFileReDim BB(FileLen(FileName) - 1)Open FileName For Binary As #sGet #s,,BBClos
Private Sub form_load()
Dim s As Integer,k As String,BB() As Byte 定义变量
Dim FileName As String,rad() As String 定义变量
FileName = "e:\频率.txt" 定义文件名
If Dir(FileName) = "" Then Exit Sub 查看文件是否存在,如果不存在就退出
s = FreeFile
ReDim BB(FileLen(FileName) - 1)
Open FileName For Binary As #s
Get #s,,BB 把文件内容以2进制方式读入数组BB
Close #s
k = StrConv(BB,vbUnicode) 转化数组中的字符方式为Unicode
rad() = split(k,vbNewLine) 以回车换行符分割K中的字符,转换到RAD中
End Sub
整段程序的意思是读入文件,以每行为单位,赋值给RAD()数组!