[vb.net]Simple Offline Databasing

Posts 1–7 of 7 · Page 1 of 1
[vb.net]Simple Offline Databasing
Credits: DeToX(Me)

Okay so anyone that knows me in the past, kno i like to use offline databasing for programs... e.g. in my antivirus program, i offline databased the Virus Sigs so to update you only need to download a new text file, also you may have seen my offline database for the virus vault


Today im going to show you a simple way to make a online database, using only a few lines of code and a text document....

so to start create a new .txt file and name is Accounts.txt, put it in the folder of you project called Debug

Now Add This Text To The File
Code:
NEW|FakeEmail69@fagswag.Com|ILIKEPUSS|
NEW|DETOXROCKSYOU@mymom.Com|DETOXROXS|
NEW|TEST@test.COM|TEST123|
you will need to:
Code:
Imports System.IO 'Give us acces to File.ReadAllText("")
okay anyways now onto the coding part.... first we are going to load it.... soo.....
Code:
Sub LoadArrayOfInfo()
Dim InfoFile as string = File.ReadAllText(Application.StartupPath & "\Accounts.txt") 'All the txt in our account.txt can now be called by InfoFile
End Sub
Now We have to split our accounts...
Code:
Sub LoadArrayOfInfo()
Dim InfoFile as string = File.ReadAllText(Application.StartupPath & "\Accounts.txt") 'All the txt in our account.txt can now be called by InfoFile
'------------------------------------------------------------------------
Dim InfoArray() as String = InfoFile.Split("NEW|") 'Splits The Strings By NEW|
End Sub
Now that the accounts are split they show up as seperated strings like this

Account@Email.com|Password|



Now we gota organise the data we split up
Code:
Sub LoadArrayOfInfo()
Dim InfoFile as string = File.ReadAllText(Application.StartupPath & "\Accounts.txt") 'All the txt in our account.txt can now be called by InfoFile
'------------------------------------------------------------------------
Dim InfoArray() as String = InfoFile.Split("NEW|") 'Splits The Strings By NEW|
'------------------------------------------------------------------------
For Each Inf as String in InfoArray
Dim Account as String = Inf.Split("|")

Next
End Sub
Now we added a loop to go through and split the strings we splitted before into usernames and passwords
so now we have

Account <-- One String
Password <-- One String

So now to access the Account and Password Do This...
Code:
Sub LoadArrayOfInfo()
Dim InfoFile as string = File.ReadAllText(Application.StartupPath & "\Accounts.txt") 'All the txt in our account.txt can now be called by InfoFile
'------------------------------------------------------------------------
Dim InfoArray() as String = InfoFile.Split("NEW|") 'Splits The Strings By NEW|
'------------------------------------------------------------------------
For Each Inf as String in InfoArray
Dim Account as String = Inf.Split("|")
'------------------------------------------------------------------------
Dim AccountName as String = Account(0)
Dim AccountPassword As String = Account(1)
Next
End Sub


Any Questions Just comment
Realy simple just string spliting

You could even add a decryption method to your program and then encrypt the accounts thats what you and me are doing for the virusDataBase right?
its in my VirusScanDLL

and yes we are using a method similar to this for our VirusSignature Database and out virus vault...
Why cant we,

Make a mysql database with the Virus info and then

have the Program use that sqltable,

and if they click the option OfflineMode it will download the VirusDataBase and read from that until it gets updated.
cause then they need internet connection to run the program...
Well what happens if we update the vault they need internet to get newones Plus how are they going to get the antivirus with out *********
How is this offline databasing rofl. String splitting <> Databasing. Offline databasing would involve MSSQL, MSAccess...or an offline database program of some sort. How are you going to query your textfile?
Posts 1–7 of 7 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Need help?