SlideShare ist ein Scribd-Unternehmen logo
1 von 10
My.Setting
◦ Introduction:
 For student-developers out there, here is a tutorial about
the My.Setting in vb.net.
 Here is a simple Log-in form which will surely help you in
your programs.


Once you already have your forms with all the
required textboxes, Labels, and buttons; see
the ‘Solution Explorer’ mostly at the upper
Right, then follow the images on the next
slides:
1. Right click
on the name of
your project,

2. Select
‘Properties’,
3. Select
Settings,

4. Fill-up the
name and its
value,

Variables that will
hold the
username and
password

*note:

Remember the Names and its corresponding Values,
you will use it later.








@ FORM LOAD:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles MyBase.Load
lblUserName.Text = My.Settings.UN
lblPassword.Text = My.Settings.PW

The names we
entered a while
back.

End Sub

This code will call the values that you entered in the properties,
In case you don’t remember the values, you can unhide the
labels from their properties.



















@ BUTTON LOGIN CLICKED:
Private Sub btnLogIn_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles btnLogIn.Click
strInUN = txtUserName.Text
strInPW = txtPassword.Text
If strInUN = My.Settings.UN And strInPW = My.Settings.PW Then
Me.Hide()
Variables that will
Form2.Show()
hold the string
txtPassword.Clear()
value that you
txtUserName.Clear()
entered,
Else
MsgBox("User Name and Password mismatch", 0)
txtPassword.Clear()
txtUserName.Clear()
End If
Form2.txtNewPassword.Text = "New Password"
Form2.txtNewUserName.Text = "New User Name"
End Sub

*note:

Please Ensure that all variables are declared,
To check if the





























@ CHANGE ACCOUNT CLICKED:
new password
Private Sub btnChangeAccount_Click(ByVal sender As System.Object, ByVal e As _
and verify
System.EventArgs) Handles btnChangeAccount.Click
password
strNewUN = txtNewUserName.Text
matched,
strNewPW = txtNewPassword.Text
If txtNewPassword.Text = txtVerifyPassword.Text Then
My.Settings.UN = txtNewUserName.Text
My.Settings.PW = txtNewPassword.Text
If strNewUN = "New User Name" Then
MsgBox("Please enter your NEW User Name", 0)
Setting the new
ElseIf strNewPW = "New Password" Then
username and
MsgBox("Please enter your NEW Password", 0)
password
Else
Me.Hide()
Form1.Show()
txtNewPassword.Clear()
txtNewUserName.Clear()
If the new
txtVerifyPassword.Clear()
password and the
End If
verification did
Else
not match,
MsgBox("Password mismatched", 0)
txtNewPassword.Clear()
txtVerifyPassword.Clear()
End If
Form1.lblUserName.Text = My.Settings.UN
To call the new
Form1.lblPassword.Text = My.Settings.PW
username and
End Sub
password at the

first form
I’ll check if I can upload the project.

Weitere ähnliche Inhalte

Ähnlich wie My.setting tutorial

Creating an Uber Clone - Part XXXX - Transcript.pdf
Creating an Uber Clone - Part XXXX - Transcript.pdfCreating an Uber Clone - Part XXXX - Transcript.pdf
Creating an Uber Clone - Part XXXX - Transcript.pdfShaiAlmog1
 
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docxLab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docxsmile790243
 
Chapter2pp
Chapter2ppChapter2pp
Chapter2ppJ. C.
 
need help completing week 6 ilab.. i will upload what I currently ha.docx
need help completing week 6 ilab.. i will upload what I currently ha.docxneed help completing week 6 ilab.. i will upload what I currently ha.docx
need help completing week 6 ilab.. i will upload what I currently ha.docxniraj57
 
Please be advised that there are four (4) programs just like this on.docx
Please be advised that there are four (4) programs just like this on.docxPlease be advised that there are four (4) programs just like this on.docx
Please be advised that there are four (4) programs just like this on.docxlorindajamieson
 
Linked In Presentation
Linked In PresentationLinked In Presentation
Linked In Presentationapweir12
 
Documentation For Tab Setup
Documentation For Tab SetupDocumentation For Tab Setup
Documentation For Tab Setupvkeeton
 
LoginFormCode
LoginFormCodeLoginFormCode
LoginFormCoderk5media
 
Cis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universityCis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universitylhkslkdh89009
 
Cis 407 i lab 6 of 7
Cis 407 i lab 6 of 7Cis 407 i lab 6 of 7
Cis 407 i lab 6 of 7helpido9
 
please code in c#- please note that im a complete beginner- northwind.docx
please code in c#- please note that im a complete beginner-  northwind.docxplease code in c#- please note that im a complete beginner-  northwind.docx
please code in c#- please note that im a complete beginner- northwind.docxAustinaGRPaigey
 
The visual studio start page is shown in the figure below
The visual studio start page is shown in the figure belowThe visual studio start page is shown in the figure below
The visual studio start page is shown in the figure belowTan Ps
 
Android Application Development - Level 2
Android Application Development - Level 2Android Application Development - Level 2
Android Application Development - Level 2Isham Rashik
 
33.docxSTEP 1 Understand the UML Diagram Analyze and under.docx
33.docxSTEP 1 Understand the UML Diagram Analyze and under.docx33.docxSTEP 1 Understand the UML Diagram Analyze and under.docx
33.docxSTEP 1 Understand the UML Diagram Analyze and under.docxgilbertkpeters11344
 
3.5 the controls object
3.5   the controls object3.5   the controls object
3.5 the controls objectallenbailey
 
Windows Forms For Beginners Part 5
Windows Forms For Beginners Part 5Windows Forms For Beginners Part 5
Windows Forms For Beginners Part 5Bhushan Mulmule
 

Ähnlich wie My.setting tutorial (20)

Creating an Uber Clone - Part XXXX - Transcript.pdf
Creating an Uber Clone - Part XXXX - Transcript.pdfCreating an Uber Clone - Part XXXX - Transcript.pdf
Creating an Uber Clone - Part XXXX - Transcript.pdf
 
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docxLab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
Lab StepsSTEP 1 Login Form1. In order to do this lab, we need.docx
 
Chapter2pp
Chapter2ppChapter2pp
Chapter2pp
 
need help completing week 6 ilab.. i will upload what I currently ha.docx
need help completing week 6 ilab.. i will upload what I currently ha.docxneed help completing week 6 ilab.. i will upload what I currently ha.docx
need help completing week 6 ilab.. i will upload what I currently ha.docx
 
Please be advised that there are four (4) programs just like this on.docx
Please be advised that there are four (4) programs just like this on.docxPlease be advised that there are four (4) programs just like this on.docx
Please be advised that there are four (4) programs just like this on.docx
 
Linked In Presentation
Linked In PresentationLinked In Presentation
Linked In Presentation
 
Documentation For Tab Setup
Documentation For Tab SetupDocumentation For Tab Setup
Documentation For Tab Setup
 
LoginFormCode
LoginFormCodeLoginFormCode
LoginFormCode
 
Cis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry universityCis407 a ilab 6 web application development devry university
Cis407 a ilab 6 web application development devry university
 
Cis 407 i lab 6 of 7
Cis 407 i lab 6 of 7Cis 407 i lab 6 of 7
Cis 407 i lab 6 of 7
 
please code in c#- please note that im a complete beginner- northwind.docx
please code in c#- please note that im a complete beginner-  northwind.docxplease code in c#- please note that im a complete beginner-  northwind.docx
please code in c#- please note that im a complete beginner- northwind.docx
 
Logical Triggers.pdf
Logical Triggers.pdfLogical Triggers.pdf
Logical Triggers.pdf
 
The visual studio start page is shown in the figure below
The visual studio start page is shown in the figure belowThe visual studio start page is shown in the figure below
The visual studio start page is shown in the figure below
 
Android Application Development - Level 2
Android Application Development - Level 2Android Application Development - Level 2
Android Application Development - Level 2
 
Visualbasic tutorial
Visualbasic tutorialVisualbasic tutorial
Visualbasic tutorial
 
Android interface elements and controls-chapter8
Android interface elements and controls-chapter8Android interface elements and controls-chapter8
Android interface elements and controls-chapter8
 
Les22
Les22Les22
Les22
 
33.docxSTEP 1 Understand the UML Diagram Analyze and under.docx
33.docxSTEP 1 Understand the UML Diagram Analyze and under.docx33.docxSTEP 1 Understand the UML Diagram Analyze and under.docx
33.docxSTEP 1 Understand the UML Diagram Analyze and under.docx
 
3.5 the controls object
3.5   the controls object3.5   the controls object
3.5 the controls object
 
Windows Forms For Beginners Part 5
Windows Forms For Beginners Part 5Windows Forms For Beginners Part 5
Windows Forms For Beginners Part 5
 

Kürzlich hochgeladen

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 

Kürzlich hochgeladen (20)

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

My.setting tutorial

  • 2. ◦ Introduction:  For student-developers out there, here is a tutorial about the My.Setting in vb.net.  Here is a simple Log-in form which will surely help you in your programs.
  • 3.
  • 4.  Once you already have your forms with all the required textboxes, Labels, and buttons; see the ‘Solution Explorer’ mostly at the upper Right, then follow the images on the next slides:
  • 5. 1. Right click on the name of your project, 2. Select ‘Properties’,
  • 6. 3. Select Settings, 4. Fill-up the name and its value, Variables that will hold the username and password *note: Remember the Names and its corresponding Values, you will use it later.
  • 7.      @ FORM LOAD: Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles MyBase.Load lblUserName.Text = My.Settings.UN lblPassword.Text = My.Settings.PW The names we entered a while back. End Sub This code will call the values that you entered in the properties, In case you don’t remember the values, you can unhide the labels from their properties.
  • 8.                  @ BUTTON LOGIN CLICKED: Private Sub btnLogIn_Click(ByVal sender As System.Object, ByVal e As _ System.EventArgs) Handles btnLogIn.Click strInUN = txtUserName.Text strInPW = txtPassword.Text If strInUN = My.Settings.UN And strInPW = My.Settings.PW Then Me.Hide() Variables that will Form2.Show() hold the string txtPassword.Clear() value that you txtUserName.Clear() entered, Else MsgBox("User Name and Password mismatch", 0) txtPassword.Clear() txtUserName.Clear() End If Form2.txtNewPassword.Text = "New Password" Form2.txtNewUserName.Text = "New User Name" End Sub *note: Please Ensure that all variables are declared,
  • 9. To check if the                            @ CHANGE ACCOUNT CLICKED: new password Private Sub btnChangeAccount_Click(ByVal sender As System.Object, ByVal e As _ and verify System.EventArgs) Handles btnChangeAccount.Click password strNewUN = txtNewUserName.Text matched, strNewPW = txtNewPassword.Text If txtNewPassword.Text = txtVerifyPassword.Text Then My.Settings.UN = txtNewUserName.Text My.Settings.PW = txtNewPassword.Text If strNewUN = "New User Name" Then MsgBox("Please enter your NEW User Name", 0) Setting the new ElseIf strNewPW = "New Password" Then username and MsgBox("Please enter your NEW Password", 0) password Else Me.Hide() Form1.Show() txtNewPassword.Clear() txtNewUserName.Clear() If the new txtVerifyPassword.Clear() password and the End If verification did Else not match, MsgBox("Password mismatched", 0) txtNewPassword.Clear() txtVerifyPassword.Clear() End If Form1.lblUserName.Text = My.Settings.UN To call the new Form1.lblPassword.Text = My.Settings.PW username and End Sub password at the first form
  • 10. I’ll check if I can upload the project.