Lab-3 Task.docx
Lab-3 Task.docx
{
public partial class Form1 : Form
{
public static Form1 Instance;
string fPath;
System.Drawing.Image fs; // Return type is Image
public Form1()
{
InitializeComponent();
Instance = this;
}
if (fileDialog.ShowDialog() == DialogResult.OK)
{
fPath = fileDialog.FileName; // Save the file path
fs = System.Drawing.Image.FromFile(fPath); // Load the image
pictureBox1.Image = fs; // Display the image in the picture box
}
fs.Save(pathWithName);
if (male.Checked)
{
std.SelectGender = "Male";
}
else
{
if (female.Checked)
{
std.SelectGender = "Female";
}
}
datastore.data.Add(std);
MessageBox.Show("SignUp Successfully");
loginForm.ShowDialog();
this.Hide();
string fPath;
System.Drawing.Image fs;
}
}
}
Datastore class:
Student class:
public class student
{
private string userName;
private string passWord;
private string selectGender;
private string selectAge;
private string fileContent;
private System.Drawing.Image fss;
private string imagePath;
//Encapsulation
public string UserName
{
get
{
return userName;
}
set
{
userName = value;
}
}
set
{
passWord = value;
}
}
public string SelectGender
{
get
{
return selectGender;
}
set
{
selectGender = value;
}
}
set
{
selectAge = value;
}
}
set
{
fileContent = value;
}
}
public string ImagePath
{
get { return imagePath; }
set { imagePath = value; }
}
}
}
Task#1
Create a Login and Signup page. When the user enters their username and password in the login form,
their Name, Age, and picture should be displayed on a new form