qiangqiang101
Newcomer
- Joined
- Nov 2, 2012
I have a module
And I put this on my form1
Me.txtCheck4Update.Text = ReadTXTValue("SERVER SET", "HttpAddressFile")
And My Setting in the txtMessage2.text is
[SERVER SET]
HttpAddressFile=http://www.something.com/server.txt
But when I debug my Application
A Warning Shows up
"ArgumentException was unhandled"
PHP:
Option Strict Off
Option Explicit On
Module TXTread
Public Function ReadTXTValue(ByRef KEY As String, ByRef Variable As String) As String
Dim NF As Short
Dim Temp As String
Dim LcaseTemp As String
Dim ReadyToRead As Boolean
AssignVariables:
NF = FreeFile()
ReadTXTValue = ""
KEY = "[" & LCase(KEY) & "]"
Variable = LCase(Variable)
EnsureFileExists:
FileOpen(NF, frmStart.txtMessage2.Text, OpenMode.Binary)
FileClose(NF)
SetAttr(frmStart.txtMessage2.Text, FileAttribute.Archive)
LoadFile:
FileOpen(NF, frmStart.txtMessage2.Text, OpenMode.Input)
While Not EOF(NF)
Temp = LineInput(NF)
LcaseTemp = LCase(Temp)
If InStr(LcaseTemp, "[") <> 0 Then ReadyToRead = False
If LcaseTemp = KEY Then ReadyToRead = True
If InStr(LcaseTemp, "[") = 0 And ReadyToRead = True Then
If InStr(LcaseTemp, Variable & "=") = 1 Then
ReadTXTValue = Mid(Temp, 1 + Len(Variable & "="))
FileClose(NF) : Exit Function
End If
End If
End While
FileClose(NF)
End Function
End Module
And I put this on my form1
Me.txtCheck4Update.Text = ReadTXTValue("SERVER SET", "HttpAddressFile")
And My Setting in the txtMessage2.text is
[SERVER SET]
HttpAddressFile=http://www.something.com/server.txt
But when I debug my Application
A Warning Shows up
"ArgumentException was unhandled"