Click here to Skip to main content
15,888,816 members
Home / Discussions / C#
   

C#

 
QuestionHow to use a file .udl as a connectionstring in csharp smart device??? Pin
Tunisien869-May-10 0:13
Tunisien869-May-10 0:13 
AnswerRe: How to use a file .udl as a connectionstring in csharp smart device??? Pin
Tunisien869-May-10 1:47
Tunisien869-May-10 1:47 
Question"Raw Ethernet Packet Sending" by "miahrugger" Pin
mragers8-May-10 23:09
mragers8-May-10 23:09 
AnswerRe: "Raw Ethernet Packet Sending" by "miahrugger" Pin
OriginalGriff8-May-10 23:14
mveOriginalGriff8-May-10 23:14 
Questionwindows picture and fax viewer Pin
jojoba20118-May-10 21:22
jojoba20118-May-10 21:22 
AnswerRe: windows picture and fax viewer Pin
Dimitri Witkowski8-May-10 21:41
Dimitri Witkowski8-May-10 21:41 
RantSOLVED Pin
jojoba20118-May-10 23:35
jojoba20118-May-10 23:35 
Questionremember user name password in login form? [modified] Pin
charles henington8-May-10 19:28
charles henington8-May-10 19:28 
Hi I am writing an email program that will have a login form. when you login with the login form (Form1.cs) it will pass the username and pass word to the gmail program (Form2.cs). This is fine and works but I can not fiqure out how to get the settings.setting form to work in order to make sure that the information is remembered. right now I am using streaam reader and stream writer to read and write the username and password to Visual Studio Project User Options File. It works simply by reading from file on textBox enter and writing to on text box exit but was hoping there was a better way to do this?

Here is the code that i currently use for this
namespace Email_Client
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

        }

        private void button1_Click(object sender, EventArgs e)
        {
            Email_Client.Form2 Email = new Email_Client.Form2();
            Email.User.Text = textBox1.Text.ToString();
            Email.Pass.Text = textBox2.Text.ToString();
            Email.Show();
            this.Hide();
        }

        private void textBox1_Leave(object sender, EventArgs e)
        {
            StreamWriter Writer = new StreamWriter(Application.StartupPath + "/acct/info/user.user");
            Writer.WriteLine(textBox1.Text);
            Writer.Close();
        }

        private void textBox2_Leave(object sender, EventArgs e)
        {
            StreamWriter Writer = new StreamWriter(Application.StartupPath + "/acct/info/pass.user");
            Writer.WriteLine(textBox2.Text);
            Writer.Close();
        }

        private void textBox1_Enter(object sender, EventArgs e)
        {
            if (checkBox1.Checked == true)
            {
                StreamReader userreader = new StreamReader(Application.StartupPath + "/acct/info/user.user");
                textBox1.Text = userreader.ReadToEnd();
                userreader.Close();
            }

        }

        private void textBox2_Enter(object sender, EventArgs e)
        {
            if (checkBox2.Checked == true)
            {
                StreamReader passreader = new StreamReader(Application.StartupPath + "/acct/info/pass.user");
                textBox2.Text = passreader.ReadToEnd();
                passreader.Close();

            }
        }

        internal static void DestroyHandle()
        {
            Form1.ActiveForm.Dispose();
        }
    }
}


modified on Sunday, May 9, 2010 1:35 AM

AnswerRe: remember user name password in login form? Pin
Stanciu Vlad8-May-10 20:58
Stanciu Vlad8-May-10 20:58 
QuestionSQL server name not found:Admin-PC\MSSQLSERVER,1433 Pin
Tunisien868-May-10 4:58
Tunisien868-May-10 4:58 
AnswerRe: SQL server name not found:Admin-PC\MSSQLSERVER,1433 Pin
Abhinav S8-May-10 5:21
Abhinav S8-May-10 5:21 
GeneralRe: SQL server name not found:Admin-PC\MSSQLSERVER,1433 Pin
Tunisien868-May-10 5:58
Tunisien868-May-10 5:58 
AnswerRe: SQL server name not found:Admin-PC\MSSQLSERVER,1433 Pin
Abhinav S8-May-10 9:06
Abhinav S8-May-10 9:06 
AnswerRe: SQL server name not found:Admin-PC\MSSQLSERVER,1433 Pin
Stanciu Vlad8-May-10 6:34
Stanciu Vlad8-May-10 6:34 
GeneralRe: SQL server name not found:Admin-PC\MSSQLSERVER,1433 Pin
Tunisien868-May-10 10:02
Tunisien868-May-10 10:02 
GeneralRe: SQL server name not found:Admin-PC\MSSQLSERVER,1433 Pin
Stanciu Vlad8-May-10 10:15
Stanciu Vlad8-May-10 10:15 
GeneralRe: SQL server name not found:Admin-PC\MSSQLSERVER,1433 Pin
Tunisien868-May-10 10:47
Tunisien868-May-10 10:47 
GeneralRe: SQL server name not found:Admin-PC\MSSQLSERVER,1433 Pin
Stanciu Vlad8-May-10 11:04
Stanciu Vlad8-May-10 11:04 
GeneralRe: SQL server name not found:Admin-PC\MSSQLSERVER,1433 Pin
Tunisien868-May-10 11:19
Tunisien868-May-10 11:19 
GeneralRe: SQL server name not found:Admin-PC\MSSQLSERVER,1433 Pin
Stanciu Vlad8-May-10 11:32
Stanciu Vlad8-May-10 11:32 
GeneralRe: SQL server name not found:Admin-PC\MSSQLSERVER,1433 Pin
Tunisien868-May-10 12:23
Tunisien868-May-10 12:23 
GeneralRe: SQL server name not found:Admin-PC\MSSQLSERVER,1433 Pin
Tunisien869-May-10 0:10
Tunisien869-May-10 0:10 
AnswerRe: SQL server name not found:Admin-PC\MSSQLSERVER,1433 Pin
Tunisien8611-May-10 5:55
Tunisien8611-May-10 5:55 
GeneralRe: SQL server name not found:Admin-PC\MSSQLSERVER,1433 Pin
Stanciu Vlad11-May-10 6:42
Stanciu Vlad11-May-10 6:42 
GeneralRe: SQL server name not found:Admin-PC\MSSQLSERVER,1433 Pin
Tunisien8611-May-10 9:06
Tunisien8611-May-10 9:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.