当前位置: > Private Sub form_load()...
题目
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

提问时间:2021-12-08

答案
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()数组!
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
版权所有 CopyRight © 2012-2019 超级试练试题库 All Rights Reserved.