示例#1
0
    protected void btnRegisterClick(object o, EventArgs e)
    {
        try
        {
            setRegisterAttributes();
            RegisterClass a = new RegisterClass();
            a.FirstName = txtFirstName.Value;
            a.lastName  = txtLastName.Value;


            r.Validate();

            // Compose a string that consists of three lines.
            string lines = txtFirstName.Value + "," + txtLastName.Value + "," + txtEmail.Value + "," + txtPassword.Value + "\n";

            // Write the string to a file.
            //System.IO.StreamWriter file = new System.IO.StreamWriter("c:\\Register.txt");
            File.AppendAllText("c:\\OOADProject\\Register.txt", lines);

            string folderName = @"c:\" + txtEmail.Value;

            System.IO.Directory.CreateDirectory(folderName);
            lblErrorHandling.Text = "Successfully Registered";
        }
        //file.WriteLine(lines);
        catch (Exception ex)
        {
            lblRegisterError.Visible = true;
            lblRegisterError.Text    = ex.Message.ToString();
        }

        //file.Close();
        //Response.Redirect("~/Default.aspx");
    }
示例#2
0
 protected void btnLoginClick(object o, EventArgs e)
 {
     try
     {
         r          = new Login();
         r.Email    = txtloginemail.Value;
         r.Password = txtloginPass.Value;
         r.Validate();
         Session["Userpath"] = "C:\\" + txtloginemail.Value + "\\";
         Response.Redirect("~/NewHomePage.aspx");
     }
     catch (Exception ex)
     {
         lblErrorHandling.Visible = true;
         lblErrorHandling.Text    = ex.Message.ToString();
     }
 }
示例#3
0
 protected void btnLoginClick(object o, EventArgs e)
 {
     try
     {
         r = new Login();
         r.Email = txtloginemail.Value;
         r.Password = txtloginPass.Value;
         r.Validate();
         Session["Userpath"] = "C:\\" + txtloginemail.Value+"\\";
         Response.Redirect("~/NewHomePage.aspx");
     }
     catch (Exception ex)
     {
         lblErrorHandling.Visible = true;
         lblErrorHandling.Text = ex.Message.ToString();
     
     }
 }