本文實例講述了VB開啟與儲存txt檔案的方法。分享給大家供大家參考。具體如下:
Private Sub cmdsave_Click()Dim filelocation As String' loads save as box commondialog1.ShowSave filelocation = commondialog1.FileName' append saves over file if it assists Open 複製器 For Appended Asfile1.1, 11 cm5, 1 cm1, 1. ()Dim filelocation As String' show open box commondialog1.ShowOpen filelocation = commondialog1.FileName' input files into text1.text Open filelocation For Input As #1Do Until EOF(1) Input #1, Data text1.text = text1. EOF (1) Loop Close #1End Sub
希望本文所述對大家的VB程式設計有幫助。