vb.net 怎样获取指定的记事本所有内容,并显示textbox中? 50
展开全部
Private Sub open()
Dim thefile as string
On Error Goto FE
If (Right(dirLook.Path,1)="\") then
TheFile=dirLook.Path+filFind.FileName
Else
TheFile=dirLook.Path+"\"+filFind.FileName
End if
Open thefile for input as #1
TEXTBOX1.text=Input(LOF(1),#1)
Close #1
Exit Sub
FE:
MsgBox"ERR"
Resume Next
End Sub
'dirLook指路径,filFind.filFind指文件名,dirlook最先为盘名
Dim thefile as string
On Error Goto FE
If (Right(dirLook.Path,1)="\") then
TheFile=dirLook.Path+filFind.FileName
Else
TheFile=dirLook.Path+"\"+filFind.FileName
End if
Open thefile for input as #1
TEXTBOX1.text=Input(LOF(1),#1)
Close #1
Exit Sub
FE:
MsgBox"ERR"
Resume Next
End Sub
'dirLook指路径,filFind.filFind指文件名,dirlook最先为盘名
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询