0% found this document useful (0 votes)
53 views4 pages

05 Laboratory Exercise Event Driven Lagyaliii

Uploaded by

jayrlagyal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views4 pages

05 Laboratory Exercise Event Driven Lagyaliii

Uploaded by

jayrlagyal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

LagyalIII, Brahim S.

BSIT 503

private void btnRegister_Click(object sender, EventArgs e)

string studentnumber = lblStudentNumber.Text;

string lastname = lblLastName.Text;

string firstname = lblFirstName.Text;

string middleinitial = lblMiddleInitial.Text;

string program = cbProgram.Text;

string gender = cbGender.Text;

string age = Age.Text;

string datepicker = DatePicker.Value.ToString("MM/dd/yyyy");

string contactnumber = lblContactNumber.Text;

string[] alloutput = {

"Student No.: " + studentnumber,

"Full Name: " + lastname + ", " + firstname + " " + middleinitial + ".",
"Program: " + program,

"Gender: " + gender,

"Age: " + age,

"Birthday: " + datepicker,

"Contact No.: " + contactnumber

};

string docPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);

string filePath = Path.Combine(docPath, $"{studentnumber}.txt");

try

using (StreamWriter outputFile = new StreamWriter(filePath))

foreach (string line in alloutput)

outputFile.WriteLine(line);

MessageBox.Show("Registration data saved successfully!", "Success", MessageBoxButtons.OK,


MessageBoxIcon.Information);

catch (Exception ex)

MessageBox.Show("An error occurred while saving the data: " + ex.Message, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);

}
private void frmRegistration_Load(object sender, EventArgs e)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy