hello m in vb6
i have a username and passwords loaded in listview and i wnana save it in txt file in form of username:password
and i dont want to delete previous data of txt file just adding data in txtx file:lol:
Printable View
hello m in vb6
i have a username and passwords loaded in listview and i wnana save it in txt file in form of username:password
and i dont want to delete previous data of txt file just adding data in txtx file:lol:
To add to an exiting flat file you have to open it for Append.
Will add the contents of strUser and strPassword (comma separated) to the end of C:\MyDir\MyFile.txt. If the file doesn't exist it will be created.Code:Dim intFile As Integer
intFile = FreeFile()
Open "C:\MyDir\MyFile.txt" For Append As intFile
Print #intFile, strUser; "," ; strPassword
Close intFile
Getting the data from the ListView will depend on which 'columns' the Username and Password are in
e.g
would assign whatever is in the first row and first 'column' of the ListView (lv) to strUser and whatever is in the second 'column' of the same row to strPassword.Code:strUser = lv.ListItems(0).Text
strPassword = lv.ListItems(0).ListSubItems(1).Text