求助 如何用vb打开txt文件啊
求助 如何用vb打开txt文件啊 --------------------编程问答-------------------- Open App.Path + "\1.txt" For Output As #1 '打开文件写入的内容
Close #1 '关闭文件 --------------------编程问答-------------------- 什么叫“用vb打开txt文件”,你是要读取还是要调用记事本显示? --------------------编程问答-------------------- Option Explicit
Dim strFile As String
Dim strMemo As String
Dim intFileNum As Integer
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'过程功能:
'功能描述:Input方式读入文件
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Private Sub btnInput_Click()
On Error GoTo errSub
strMemo = ""
intFileNum = FreeFile(0)
Open strFile For Input As #intFileNum
Input #intFileNum, strMemo
Close #intFileNum
txtMemo.Text = strMemo
Exit Sub
errSub:
End Sub
Private Sub Form_Load()
strFile = App.Path & "\111.txt"
strFile = "E:\abc" & StrConv(StrConv("?", vbFromUnicode), vbUnicode) & "cde.text"
End Sub
--------------------编程问答--------------------
补充:VB , 网络编程