Last post Sep 13, 2009 07:33 AM by hans_v
Sep 10, 2009 11:14 PM|XBOXv2|LINK
I have a application that I am working on and I am trying to make it so there are 3 boxes where you enter 5 characters in each of the 3 boxes to login, example: GY5DU T2CV8 KP92Q. Is their anyway to make it so I can create a database which has the keys needed
to login? Here is what I have so far:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim UserName As New System.IO.StreamReader(CurDir() & "\Resources\secure\access.txt")
Dim code1, code2, code3 As String '
code1 = UserName.ReadLine()
code2 = UserName.ReadLine()
code3 = UserName.ReadLine()
If code2 = TextBox4.Text And code3 = TextBox5.Text Then
---The only problem I have with this is that the text file which contains the 15 character code to login has to be on the users local machine. I was needing for it to be located on the server or to have a database which has the login details. If there is
a way to have a database, please tell me how I would set one up.
Sep 11, 2009 02:40 AM|mroonal|LINK
First create text file on application_start event in global.asax file.
(better way store it with encryption)
then you can read it later.
Hope this helps you.
Sep 12, 2009 10:17 PM|XBOXv2|LINK
I am just trying to make it so the script above shows a http url to the text file, for example: http://website.com/key.txt I want to replace \Resources\secure\access.txt. Everytime I try to put a url in place of the local .txt file it gives me the error
below. I am guessing it is because how I have this script setup, it does not allow for http urls, I need a way so I can use http urls.
I need to know away to allow for an http url to the . txt file so that the key can be read from a http server.
Once again, here is the code I am using for this login app:
Here is the code that I am wanting to use but am getting an error:
Dim UserName As New System.IO.StreamReader(CurDir() & "http://website.com/key.txt")
Sep 13, 2009 04:45 AM|hans_v|LINK
Is their anyway to make it so I can create a database which has the keys needed to login?
Sure you can, but I don't see why you should use a database, if the code is the same for everybody? Instead of storing it in just another text file (you would need to make sure that it couldn't be downloaded if somebody would know the URL), I would place
the code in web.config:
<add key="code1" value="GY5DU"/>
<add key="code2" value="T2CV8"/>
<add key="code3" value="KP92Q"/>
And then you can access these codes in VB.NET like:
Dim Code1 as string = ConfigurationManager.AppSettings("code1")
Dim Code2 as string = ConfigurationManager.AppSettings("code2")
Dim Code3 as string = ConfigurationManager.AppSettings("code3")
Sep 13, 2009 07:16 AM|XBOXv2|LINK
Sep 13, 2009 07:33 AM|hans_v|LINK
I already said, you don't need a text file at all if you place the codes in web.config!!!!