I have a program i made, compiled as an .exe; though each user needs to enter their IP the first time it's opened to have it store their IP.
Then i need it to be possible for them to change it when their IP changes.
How can i do this without changing the code in every project and compiling it separately?
I dont think i understood you quite well, but you have two options, in the code, instead of writing the IP use a String variable, then just put an inputbox where they write their IP each time they start the program. If each user want to save a defoult IP, save it into another archive, the easiest way will be a TXT file.
Something like this will read the file and save its first line into the string called defoultIP or do nothing if the file doesnt exist
- Dim defoultIP as string
-
Dim myIP as string
-
on error resume next
-
open "c:\myIPs.txt" for input as #1
-
input #1, defoultip
-
close #1
now here we'll ask for an IP adress showing the defoult as the one we've already read. In case we use a different one, it'll be saved as de defoult one.
If there wasnt a defoult one, it'll show the empty string.
- myip = inputbox("Please write your IP adress", "IP adress", defoultip)
-
if myip <> defoultip then
-
open "c:\myIPs.txt" for output As #1
-
print #1, myip
-
close #1
-
end if
and now you have the ip stored in myIP
HTH