-
July 23rd, 2012, 10:36 AM
#1
Using a CheckBox with a log in GUI
I am just beginning C Sharp and I am currently focused on GUI creation. I am making a "log in" page for a program that would require you to log in to use it. Of course its offline since I am not done with it, so any "username" "password" combination would work, but I can't get the checkbox to save the information from the usernameBox or the passwordBox when I press the rememberBox (check box). Here's what I got so far.
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MichPierce
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//Programing the Close button to close when clicked.
private void closeButton_Click(object sender, EventArgs e)
{
Close();
}
//Programming the Log In button to populate characters into username/password boxes.
private void loginButton_Click(object sender, EventArgs e)
{
usernameBox.Text = "m1tal1k";
passwordBox.Text = "*********";
}
//Reset button clears the username/password boxes.
private void resetButton_Click(object sender, EventArgs e)
{
usernameBox.Text = "";
passwordBox.Text = "";
}
}
}
-
July 23rd, 2012, 10:37 AM
#2
Re: Using a CheckBox with a log in GUI
Also I am using Visual Studos 2012.
-
July 23rd, 2012, 04:03 PM
#3
Re: Using a CheckBox with a log in GUI
If you need the username/password info to persist between different times of using the app, you are going to need to write that functionality yourself. Typically, you'll encrypt the data and save it to a settings file or the registry. Then when the login dialog appears, you'll read the data back out.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|