473,752 Members | 10,802 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to make a simple login/registration vb6

15 New Member
Ok First I have a very simple way of entering data into a form and saving that into a text file,

I made two text files for username(text1) and password(text2) , I would like to make a simple login with the outcome out this,

Code for Registration:

Expand|Select|Wrap|Line Numbers
  1. Dim savefile As Long
  2. savefile = FreeFile()
  3. Open "I:\College Work ------- Updated 2008 March\new-work\savedfile.txt" For Output As #savefile
  4. Write #savefile, (Text1.Text); (Text2.Text)
  5. Close #savefile
From entering data it is saved into 'savedfile.txt' , and is displayed as:

"carl2k2","mypa ssword"

I would Like to have a simple login form so it would ask for the user to input their username and password(using two seperate text boxes again), so it will read the 'savedfile.txt' to see if what the user entered is correct, if then not then a simple if statement would be like msgbox("Incorre ct Values,") or something like that,

(ps, I did have a similar post but that was about something else which I dont think I need now)
Apr 2 '08 #1
1 3079
jeffstl
432 Recognized Expert Contributor
Ok First I have a very simple way of entering data into a form and saving that into a text file,

I made two text files for username(text1) and password(text2) , I would like to make a simple login with the outcome out this,

Code for Registration:

Expand|Select|Wrap|Line Numbers
  1. Dim savefile As Long
  2. savefile = FreeFile()
  3. Open "I:\College Work ------- Updated 2008 March\new-work\savedfile.txt" For Output As #savefile
  4. Write #savefile, (Text1.Text); (Text2.Text)
  5. Close #savefile
From entering data it is saved into 'savedfile.txt' , and is displayed as:

"carl2k2","mypa ssword"

I would Like to have a simple login form so it would ask for the user to input their username and password(using two seperate text boxes again), so it will read the 'savedfile.txt' to see if what the user entered is correct, if then not then a simple if statement would be like msgbox("Incorre ct Values,") or something like that,

(ps, I did have a similar post but that was about something else which I dont think I need now)
One thing to note is that the format of your .txt string must be consistent for this below to work.

In other words, in this example user name is always 5 characters long as well as password


Expand|Select|Wrap|Line Numbers
  1. Open strFileName For Input As #1
  2. Line Input #1, strrecord   
  3. strUser= Left(strrecord, 5) 'use these string filters to get your values 
  4. strPass= Mid(strrecord, 10, 5) 'use these string filters to get your values 
  5.  
  6.  
I didn't actually test this for accuracy but check this out for a better examples
http://www.w3schools.com/vbscript/func_mid.asp

It will be something like that though to get those values then compare them to the entered values of the text boxes

Expand|Select|Wrap|Line Numbers
  1. if txtUserName.Text <> strUser then
  2.      'invalid user
  3. end if
  4.  
Apr 2 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2680
by: JaNE | last post by:
Hello, I have made my cms... and is working, but have some, let me say "bugs"... And I don't know all reasons, please allow me slightly longer and most probably confusing post (that "confusing" is mainly becaose of my bad english, and that bad english is also reason why am I learning php that slow...). As first, what is problem: some users after succsesfull registration and login can not see "memeber_menu" and can not activly participate...
18
3396
by: Gleep | last post by:
I've searched google intensely on this topic and it seems noone really knows how to approch this. The goal I don't want clients to give out their usernames and passwords to friends, since the site relies on subscrption fees. Sessions ID's are matched between the browser and the server. So a users can login with same username and password and those sessions are tracked individually. Some suggest create table fields with the session ID...
5
1278
by: Newbie | last post by:
Hi all, Just want to comment on this thread. Seems like every discussion about this matter (setting up DB provider for membership) and all the samples/references given by some MVPs always refering to LOCALHOST in their solution. Aren't they all forget that people build an ASP.NET appl are plans to host their appl in an commercial hosting provider, whom most of them can't afford the fancy of dedicated servers - most of them hosts on shared...
2
2416
by: drah | last post by:
Hello not exactly sure if it is a php script problem or a database/table issue i apologize if i'mposting in wrong category. I was asked to put a login script on a site for someone and i made the database,tables needed but when you enter a username and password to register the database,table records dont write the information so when attempting to login it states name/pass dont exist here is the registration.php file if anyone can point me in the...
6
3358
by: AppleBag | last post by:
I'm having the worst time trying to login to myspace through code. Can someone tell me how to do this? Please try it yourself before replying, only because I have asked this a couple of times in the past in other places, and while the help was much appreciated, it seemed everyone just wanted to 'theoretically' explain how to do it, but when I tried to do it myself, I couldn't login. I want to simply pass the email address and password to...
1
1539
by: wislace | last post by:
Please I have created a Login Page and a Registration Page Using Dreamweaver.Please Can somebody help me so that when somebody Login,it opens a Window that contains only His Registration Page
0
6494
by: sandy | last post by:
hello,,,,,,,,, i am creating login page using Perl/CGI facing prob... able to connect DB but from there facing prob If u have related code of login page in Perl please send me on sandip.bhosale@gmail.com please help me i am using MySQL as DB user name:root password:root database name:ITS
3
6224
by: satishknight | last post by:
Hi, Can some one tell me how to change the validation sequence for the code pasted below, actually what I want it when any one enters the wrong login information (already registered users) then it has to tell then them its wrong information but currently it takes then to a next page and then tells them its incorrect information. This is tedious as every time they enter wrong they will be redirected to a different page and then they have to...
3
1915
by: jerrydigital | last post by:
Hello, I have created a login.asp page which i have posted below. When I login into my site, it automatically takes me to the redirect page "index.html" which means that i entered the wrong login information. I believe i am not connecting to the access table correctly. Here are some of the characters I used(hope this helps clear up my asp page) Email --- this is the title to the login column in my access table Password --- password...
0
9020
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9371
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9279
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8282
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6101
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4726
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4910
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3340
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2237
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.