info from file

hello,
I have this in Accounts.ini

[UserNames]
Text_Email=name@mail.com
Text_Password=temp123

and this in my VB6 but how do I make it so it reads email and password?
WebBrowser.Document.Forms("MailForm").All("email").Value = App.Path & "\Accounts.ini"
WebBrowser.Document.Forms("MailForm").All("password").Value = App.Path & "\Accounts.ini"
apleloisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SethiCommented:
This is an INI format. The following links will help you:

Use Registry Instead of INI
Registry is a better way to use instead of INI. Here are two links that will be of help:
http://www.vbaccelerator.com/home/VB/Code/Libraries/Registry_and_Ini_Files/Easy_Ini_File_Access/article.asp
http://www.thescarms.com/VBasic/registry.asp

Advantage Of Registry Over INI
http://www.pcsupportadvisor.com/windows_registry_tutorial_page1.htm

Complete Registry Control
http://www.vbaccelerator.com/home/VB/Code/Libraries/Registry_and_Ini_Files/Complete_Registry_Control/article.asp
0
vinnyd79Commented:
If thats all you need from the file you can try something like this:

Private Type UserInfo
    UserName As String
    Password As String
End Type

Private Sub Command1_Click()
Dim AccInfo As UserInfo
AccInfo = UserSettings(App.Path & "\accounts.ini")

MsgBox AccInfo.UserName
MsgBox AccInfo.Password

End Sub

Private Function UserSettings(AccFile As String) As UserInfo
Dim ff As Integer, fData As String, p As Integer
ff = FreeFile
Open AccFile For Input As #ff
fData = Input$(LOF(ff), ff)
Close #ff
p = InStr(fData, "Text_Email=") + 11
UserSettings.UserName = Trim$(Mid$(fData, p, InStr(p, fData, vbCrLf) - p))
p = InStr(fData, "Text_Password=") + 14
UserSettings.Password = Trim$(Mid$(fData, p, InStr(p, fData, vbCrLf) - p))
End Function
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
apleloisAuthor Commented:
thanks for your code.. instead of MsgBox how can I display it as label ?
0
vinnyd79Commented:
Private Sub Command1_Click()
Dim AccInfo As UserInfo
AccInfo = UserSettings(App.Path & "\accounts.ini")

Label1.Caption = AccInfo.UserName
Label2.Caption = AccInfo.Password

End Sub
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.