
VB里 如何复制的个文本!
比如我创建一个记事本,TEXT1.TEXT,当单击“打开”菜单,打开一个文本位置于“D:\123.TXT”的123.TXT文档!并将123.TXT的内容复制到TEXT1....
比如我创建一个记事本,TEXT1.TEXT,当单击“打开”菜单,打开一个文本位置于“D:\123.TXT”的123.TXT文档!
并将123.TXT的内容复制到TEXT1.TEXT中,该怎样操作?
谢谢! 展开
并将123.TXT的内容复制到TEXT1.TEXT中,该怎样操作?
谢谢! 展开
1个回答
展开全部
Dim tempword, temptxt As String
Dim textFile As String
textFile = "D:\123.txt"
Open textFile For Input As #1
Do While Not EOF(1)
Line Input #1, tempword
temptxt = temptxt + "" + tempword + Chr(13) + Chr(10)
Loop
Text1.Text = temptxt
Close #1
Dim textFile As String
textFile = "D:\123.txt"
Open textFile For Input As #1
Do While Not EOF(1)
Line Input #1, tempword
temptxt = temptxt + "" + tempword + Chr(13) + Chr(10)
Loop
Text1.Text = temptxt
Close #1
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询