我有一個VB6程序,保存在一個文本框中的文本到一個文件,當你再次打開它,同樣的文本將在那裏,但每當我重新打開它文本框文本現在有引號,如何刪除引號?代碼:VB6行情出現,只要你打開應用程序
Private Sub Form_Load()
On Error GoTo NoFile
Randomize
Dim sFile As String
Dim Blank As String
Dim c1Path As String
Dim iFileNum As Integer
sFile = "C:\JPLData"
iFileNum = FreeFile
Open sFile For Input As iFileNum
Line Input #iFileNum, c1Path
Close #iFileNum
Text1.Text = c1Path
NoFile:
If Err.Number = 5 Then
sFile = "C:\JPLData"
c1Path = "No Custom Defined."
iFileNum = FreeFile
Open sFile For Output As iFileNum
Write #iFileNum, Text1.Text
Close #iFileNum
End If
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim sFile As String
Dim cName As String
Dim iFileNum As Integer
sFile = "C:\JPLData"
cName = vbClrf & Text1.Text & vbClrf
iFileNum = FreeFile
Open sFile For Output As iFileNum
Write #iFileNum, cName
Close #iFileNum
End Sub
編輯: 我已經回答了我自己的問題,我 拼寫vbCrLf錯誤的,我foorgot在BLsnk變量添加到辦理行情:P