read configuration from own exefile
Posted: Wed Mar 16, 2005 1:55 pm
Hi
I want to make my executable read a string from itself.
the string is added like this:"CONFstringCONF" to the end of the exe by another program.
i did this often on VB6 but got no clue how to do it in PB
in vb the function looked like this:
it reads the whole data into a string and searches it for "CONF" to get the string between CONF.
Is there any quick way of doing this in PB? i'm sure it is possible.
thx for any help :roll:
I want to make my executable read a string from itself.
the string is added like this:"CONFstringCONF" to the end of the exe by another program.
i did this often on VB6 but got no clue how to do it in PB
in vb the function looked like this:
Code: Select all
Function readsett(configname)
On Error Resume Next
Dim FileNumber As Integer
Dim SplitConfig() As String
Dim ReadString As String
Dim FileNameConfig As String
FileNumber = FreeFile
Open App.Path & "\" & App.EXEName & ".exe" For Binary Shared As #FileNumber
ReadString = Space$(100001)
Get #FileNumber, LOF(FileNumber) - 100000, ReadString
SplitConfig = Split(ReadString, configname)
readsett = SplitConfig(1)
Close #FileNumber
End FunctionIs there any quick way of doing this in PB? i'm sure it is possible.
thx for any help :roll: