1个回答
展开全部
'以下是读记事本代码,读取后的数据存储在数组hs()中:
Dim i As Long, hs() As String
i = 0
ReDim hs(0)
Open App.Path & "\1.txt" For Input As #1
Do While Not EOF(1)
ReDim Preserve hs(i)
Line Input #1, hs(i)
i = i + 1
Loop
Close #1
'以下是写记事本代码:
dim filename as string
filename = "这是第一行" & chr(13) & chr(10) & "这是第二行" & chr(13) & chr(10) & "这是第三行" & chr(13) & chr(10)
Open App.Path & "\2.txt" For Output As #1
Seek #1, 1
Print #1, filename
Close #1
Dim i As Long, hs() As String
i = 0
ReDim hs(0)
Open App.Path & "\1.txt" For Input As #1
Do While Not EOF(1)
ReDim Preserve hs(i)
Line Input #1, hs(i)
i = i + 1
Loop
Close #1
'以下是写记事本代码:
dim filename as string
filename = "这是第一行" & chr(13) & chr(10) & "这是第二行" & chr(13) & chr(10) & "这是第三行" & chr(13) & chr(10)
Open App.Path & "\2.txt" For Output As #1
Seek #1, 1
Print #1, filename
Close #1
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询