username and password in a data file??? which kind of security is that?
To write two strings in a binary file:
and to read them:
Dim f As Integer
f = FreeFile
Open "c:\s.dat" For Binary Access Write As f
Dim u As Variant
Dim p As Variant
u = "My user account"
p = "My password"
Put f, , u
Put f, , p
The strings must be in a Variant so VB knows how to convert them from the file.
Open "c:\s.dat" For Binary Access Read As f
Get f, , u
Get f, , p
But careful: anyone can open the file in notepad and read them!