Documente Academic
Documente Profesional
Documente Cultură
2 |
3 ......................... ................................ ................................
8 ..........................................................................
10 ..................... ................................................................
12 ...................................................... ................................
12 ......................................................
12 .....................................................................
12 ........... RAM(Random Access Memory)
13 ................................ Central Processing Unit
14 ........................................................................... Devices
14 .................................... ................................
16 ....................................... ................................
19 .................................................. ................................
20 ............. ................................ ................................
20 .......................................... Framework Class Library
21 ............................................... ................................ CLRMSIL
21 ....................... Automatic Garbage Collector
21 ..................................... Code Access Security
22 ............................................... Code Verification
22 ....................... ................................
3 |
23 .............................................. ................................
26 .. ................................................................
26 .................................................. ................................
27 ................................................. Solution Explorer
28 ............. ................................ Properties Window
28 ..................................................................... ToolBox
29 ................................................. ................................
30 .. ................................................................ Error List
31 ............................................................
36 ................................................ ................................Controls
36 ......................................... ................................ Properties
37 ................................................... ................................ Events
38 ......................................... ................................ Comments
38 ..................................................................... Variables
40 .............................................. ................................
41 .................................... ................................ Data Types
45 ............................................ ................................
46 ............................................... ................................ /
46 ............................. Arithmetic operators
47 ....................... String Concatenation operators
4 |
48 .............................................. Comparison operators
49 ....................................... Assignment Operators
50 ................................................... Logical operators
52 ......................... Short Circuited Operators
54 ..............................................................If
58 .............................................. Select Case
60 ...................................................... IIF
61 ....................................... ................................ Loops
62 ............................................... For Next
66 ............................................... Do..Loop
66 ........................................... Do..While
69 ............................................... ................................ While
69 ................................................. ................................While
69 ................................................ Do..Until
69 ................................ ................................ WhileUntil
71 .................................................. For EachNext
73 ...................................................... ................................ With
74 ................................................ ................................ Arrays
76 ................................. ................................
76 ....................................................
78 ................................ ................................
5 |
79 .....................................................................
85 ....................... ................................ Sorting Arrays
87 .......................................... ................................
89 ....................................... ................................
91 ..................................................................... Enumerations
98 ........................ ................................Handling Strings
98 .....................................................................
98 ...........................................................................
99 ............. ................................ ................................
100 ............................... ................................ SubString
102 ................................................................ Splitting
103 ............................................................. Concatening
105 ......................... ................................ Contains
108 ................................................................ Replace
108 ....................................... ................................Insert
109 ............................... ................................ Compare
110 ................... ................................................................ Format
112 ................................................. ................................
115 .......................................... ................................
123 ....................................... Functions and Procedures
6 |
132 .................................................. ................................
138 ........................................... Exceptions Handling
140 ............... Structured Exception Handling
144 .... Unstructured Exception Handling
147 ............................ ................................................................
7 |
8 |
1.0
2003
9 |
2015
Programming Program
Programming Languages
Operators Data Types Variables
Arrays Loops Conditions
String, Currency Exceptions Handling
and Date Handling
2015
10 |
Object Oriented Programming
11 |
Hardware
Software
Hardware
12 |
Addressing
Address
13 |
:Devices
Input devices
Output Devices
Storage Devices
10
14 |
Binary Language
1 0
10
( )
Binary encoding 1 0
) Decimal encoding
: ( 9 0
.
15 |
Programming Program
Language
Binary Machine Code Machine Language
Language
InterepterCompiler
16 |
VB.Net
VB.Net
F# C++C#VB.Net
Basic
1963 VB.Net
VB.Net
ASP.Net
17 |
2
Low Level Languages
High Level Languages
VB.Net
Visual Basic 1.019901963
Visual
Basic 6
18 |
Microsoft VB.Net
2015 Visual Studio
2015
http://www.microsoft.com/en-us/download/details.aspx?id=44934
http://download.microsoft.com/download/4/A/0/4A0D63BC -0F59-45E3-A0FF-
9019285B3BC5/vs2015.preview_ult_ENU.iso
19 |
Framework Class
Library
20 |
CLRMSIL
ILMicrosoft Intermediate LanguageMSIL
Common CIL Intermediate Language
Intermediate Language
Compiling
Runtime
Just-In-Time CompilerJIT
CLR
Common Language Runtime
CLR
Objects CLR
CLR
Garbage Collector
CLR CAS
21 |
CLR
Code Verification
CLR
Handling Exceptions
IL JIT CLR
CLR
22 |
Start
Visual Studio
23 |
4
New File
Project
24 |
( ) 6
Visual Basic
First Windows Forms Application
Program
OK
25 |
File
Edit
26 |
Project
:Solution Explorer 2
View
Ctrl+Alt+L
Solution Explorer 9
27 |
:Properties Window 3
Events
Properties Window View
F4
Properties Window 10
:ToolBox 4
28 |
Ctrl+Alt+X View
ToolBox 11
: 5
29 |
Form Design 12
:Error List 6
Error List 13
30 |
Button
All Windows Forms Common Controls
14
15
31 |
Properties Window
TextF4
16
32 |
Form1 Class
Classes
Method
Click
End Sub
33 |
Events Methods
End Sub
MsgBox(")"
MsgBox
StartF5
34 |
35 |
Controls
Form
ListBox Button Textbox
.Toolbox
Properties
F4
Control
36 |
.
Events
Click
Procedure
37 |
Comments
Compiler
Documentation
'
'
'
'
'
Variables
38 |
Screen
Variables
Runtime
39 |
Runtime
Dim
Dim
AS VARIABLE_NAME
40 |
Dim myBool As Boolean '
Data Types
String Integer
Common
Language Runtime (CLR)
41 |
Floating-PointInteger
Integer
Byte
32 -32 768Short2550
Floating-Point 767
Double
42 |
:1
ULong UInteger U
Unsigned LongUnsigned Integer
Unsigned
Unsigned
65,5350UShort
:2
Int32 Int16
Int64
IntegerInt32
43 |
Short Int16
Integer Int32
Long Int64
String
Char
. False True 2 Boolean
255 0 1 Byte
127 -128 1 SByte
Unicode Symbol 2 Char
9999 31 0001 1 8 Date
16 Decimal
8 Double
2,147,483,647 -2,147,483,648 4 Integer
4,294,967,295 0 4 UInteger
-9,223,372,036,854,775,808 8 Long
9,223,372,036,854,775,807
18,446,744,073,709,551,615 0 8 ULong
Object 4 Object
32,767 - 32,768 2 Short
65,535 0 2 UShort
-3.4028235E38 4 Single
3.4028235E38
Unicode Character 2 0 2 String
44 |
156 myNumber1
myNumber2
45 |
Number2 Number1
540
Arithmetic operators
+
-
*
/
\
46 |
Mod
^
'
Dim Dif As Integer = FirstNumber - SecondNumber
'
Dim Mul As Integer = FirstNumber * SecondNumber
'
Dim Div As Integer = FirstNumber / SecondNumber
'
Dim IntDiv As Integer = FirstNumber \ SecondNumber
'
Dim Modulus As Integer = FirstNumber Mod SecondNumber
'
Dim Exp As Integer = FirstNumber ^ SecondNumber
&
47 |
Dim FirstString As String = "Think First "
Dim SecondString As String = "Code Later"
Dim ResultString As String = FirstString & SecondString
'
Dim ResultString As String = FirstString + SecondString
ResultString
Think First Code Later
Comparison operators
boolean
false true
>
<
=
<>
>=
<=
'5 4
Dim Value1 As Boolean = 4 > 5
'5 4
Dim Value2 As Boolean = 4 < 5
48 |
'5 4
Dim Value3 As Boolean = 4 = 5
'5 4
Dim Value4 As Boolean = 4 <> 5
'5
Dim Value5 As Boolean = 4 <= 5
'5 4
Dim Value6 As Boolean = 4 >= 5
Assignment Operators
=
^=
*=
/=
\=
+=
-=
&=
49 |
' 5
myVariable = 5
25 2 5 2
myVariable ^= 2
'50 2 25 2
myVariable *= 2
'25 2 50 2
myVariable /= 2
'12 2 25 2
myVariable \= 2
'14 2+12 2
myVariable += 2
'12 2 14 2
myVariable -= 2
'127 7 12 7
myVariable &= 7
Logical operators
50 |
OR
'
Dim Value1 As Boolean = (3 < 4 And 7 > 5) 'Value1 = True
'( 8 5)
Dim Value2 As Boolean = (10 > 9 And 5 = 8) 'Value2 =
False
'
Dim Value3 As Boolean = (8 < 4 Or 6 > 2) 'Value3 = True
'
Dim Value4 As Boolean = (1 > 9 Or 6 = 3) 'Value4 = False
'
Dim Value5 As Boolean = (1 > 9 Or 6 / 2 = 3) 'Value5 =
True
51 |
Short Circuited Operators
AND
False
False
ANDTrue
AndAlso
AND
OR
True True
False
OR
True True
True
52 |
OrElse
True
OrElseAndAlso
'Value1 = False
Dim Value1 As Boolean = (3 > 4 AndAlso 7 > 5 AndAlso 8
> 4)
'Value2 = True
Dim Value2 As Boolean = (5 > 9 OrElse 4 = 2 * 2 OrElse
6 < 4)
False Value1
AndAlso False
4TrueValue2
OrElse True 2 * 2
True
53 |
If
Messenger Skype
Condition
Flow Control
If ' Then
'
ElseIf ' Then
'
Else
'
End If
If
ElseIf
Else
54 |
Windows
Forms Application
txtUserName TextBox
txtPassWord TextBox
lblUserName Label
lblPassWord Label
btnOK Button
55 |
btnCancel BuTTon
btnOK
PassWord UserName
myPWD123myUserName
56 |
Else
57 |
Select Case
Select Case
If
If
Select Case
Case
Case Else
58 |
txtNumber TextBox
lblNumber Label
btnOK Button
ClickbtnOK
'
Dim PlanetCount As Integer = 9
'
Dim PlanetCountEnterred As Integer =
Val(txtNumber.Text)
IIf(, , )
IIF
Access_State
myPWD123 Password
myPWD123 Password
Access_State
60 |
Loops
61 |
For Next
For..Next
Count
EndStart
Step
Exit For
Next
lbNumbers ListBox
btnRepeat Button
For..Next
62 |
Click btnRepeat
End Sub
Count
100
LbNumbers
63 |
1 Step
Step
64 |
65 |
Do..Loop
Do..Loop
: Do..While
While
True
Do
'
Loop While '
Windows Forms Application
66 |
lblNumber Label
txtNumber TextBox
btnCalculate Button
lbDetails ListBox
btnCalculateClick
End Sub
Number
Val txtNumber
0 Counter
Number
Counter
10
67 |
10 0
8
Do While
While
Loop While
68 |
:While
Do While 1 = 3
MsgBox(")"
Loop
1 While
While
:While
Do
MsgBox(")"
Loop While 1 = 3
While
Do..Until
Do..While
UntilDo
:While Until
While Until
True
False
WhileUntil
69 |
Private Sub btnCheck_Click(sender As Object, e As
EventArgs) Handles btnCalculate.Click
End Sub
10
10 Counter
70
70 |
While
Do Until
Loop
Do Until 1 = 3
MsgBox(")"
Loop
Do
MsgBox(")"
Loop Until 1 = 3
For EachNext
71 |
Windows Forms Application
lblName Label
txtName TextBox
btnSplit Button
lbDetails ListBox
Click btnSplit
72 |
For Each chr As Char In FullName
Me.lbDetails.Items.Add(chr)
Next
End Sub
FullName
For EachtxtFullName
ListBox
With
Object With
Button1.Text = ""
Button1.BackColor = Color.Blue
Button1.Size = New Point(100, 40)
Button1.ForeColor = Color. Yellow
Button1.TextAlign = ContentAlignment.MiddleCenter
Button1.Focus()
With Button1
With Button1
.Text = ""
73 |
.BackColor = Color.Blue
.Size = New Point(100, 40)
.ForeColor = Color.Yellow
.Focus()
.TextAlign = ContentAlignment.MiddleCenter
End With
Arrays
74 |
Arrays
Value
Index
75 |
Index
one-dimensional
array
Double
76 |
Dim Marks() As Double = {20, 19, 14, 17, 13, 11.5,
16.25, 18.75, 9, 15}
10
20 0
19 1
14 2
17 3
13 4
11.5 5
16.25 6
18.75 7
9 8
15 9
Marks(0) = 20
Marks(1) = 19
Marks(2) = 14
Marks(3) = 17
Marks(4) = 13
Marks(5) = 11.5
Marks(6) = 16.25
Marks(7) = 18.75
Marks(8) = 9
Marks(9) = 15
77 |
Length
10
Count
MsgBox(Marks.Count)
78 |
MsgBox(Marks(8))
Average
ListBox
79 |
lblArray Label
txtArray TextBox
btnAvg Button
lbDetails ListBox
ClickbtnAvg
intArray(Count) = Rand.Next(100)
lbDetails.Items.Add(intArray(Count))
Sum += intArray(Count)
Next
End Sub
80 |
Dim ItemCount As Integer = Val(txtArray.Text)
ItemCount
intArray
Rand
Sum
81 |
intArray(Count) = Rand.Next(10)
100
RandomRandNext
lbDetails.Items.Add(intArray(Count))
ListBox
lbDetails
Sum += intArray(Count)
82 |
10
83 |
Dim WeekArray(6) As String
WeekArray(0) = ""
WeekArray(1) = ""
WeekArray(2) = ""
WeekArray(3) = ""
WeekArray(4) = ""
WeekArray(5) = ""
WeekArray(6) = ""
84 |
Sorting Arrays
ArraySort
NamesArray(0) = ""
NamesArray(1) = ""
NamesArray(2) = ""
NamesArray(3) = ""
NamesArray(4) = ""
Array.Sort(NamesArray)
Me.lbDetails.Items.AddRange(NamesArray)
ListBoxAddRange
Add
85 |
Array.Sort(NumbersArray)
86 |
Array Sort
ArrayReverse
'
Me.lbDetails.Items.Add(")"
For Each Item As Integer In myArray
Me.lbDetails.Items.Add(Item)
Next
'
Array.Sort(myArray)
Me.lbDetails.Items.Add(")"
For Each Item As Integer In myArray
Me.lbDetails.Items.Add(Item)
87 |
Next
'
Array.Reverse(myArray)
Me.lbDetails.Items.Add(")"
For Each Item As Integer In myArray
Me.lbDetails.Items.Add(Item)
Next
88 |
6 3
183*6
TwoDimArray(0, 3) = 23
TwoDimArray(1, 4) = 195
TwoDimArray(2, 1) = 56
89 |
'
Dim myArray(1, 2) As Integer
'
myArray(0, 0) = 7
myArray(0, 1) = 2
myArray(0, 2) = 5
'
myArray(1, 0) = 3
myArray(1, 1) = 8
myArray(1, 2) = 6
'
Dim row, col As Integer
'
For row = 0 To 1
'
For col = 0 To 2
lbDetails.Items.Add(myArray(row, col))
Next
Next
myArray
90 |
Enumerations
Constants
91 |
Windows Forms Application
lblColor Label
cmbColor ComboBox
Enumerations
View Code
92 |
Enum EnumColors
Red
Blue
Green
Purple
Orange
End Enum
End Class
EnumColors
93 |
0 Red
1 Blue
2 Green
3 Purple
4 Orange
Enum EnumColors
Red = 4
Blue = 2
Green = 1
Purple = 3
Orange = 0
End Enum
cmbColor
Form_Load
94 |
Me.cmbColor.Items.AddRange(ArrayColors)
cmbColor ComboBox
SelectedIndexChanged
EnumColors
95 |
Enumerations
Enum EnumColors
Red
Blue
Green
Purple
Orange
End Enum
Me.cmbColor.Items.AddRange(ArrayColors)
End Sub
96 |
Private Sub cmbColor_SelectedIndexChanged(sender As
Object, e As EventArgs) Handles cmbColor.SelectedIndexChanged
Select Case cmbColor.SelectedIndex
Case EnumColors.Red
Me.BackColor = Color.Red
Case EnumColors.Blue
Me.BackColor = Color.Blue
Case EnumColors.Green
Me.BackColor = Color.Green
Case EnumColors.Purple
Me.BackColor = Color.Purple
Case EnumColors.Orange
Me.BackColor = Color.Orange
End Select
End Sub
End Class
97 |
Handling Strings
LenLength
UCase
ToUpper
98 |
Dim Name As String = "khalid"
MsgBox(Name.ToUpper())
'
MsgBox(UCase(Name))
ToUpper UCase
KHALIDkhalid
LCase UCase
ToUpper
ToLower
99 |
SubString
string_Name
start_Index
01
Length
Mid
100 |
KHALID strResult1
KHA 3
strResult2
HALI4KHALID
String SubString
String_Name.Substring(start_Index, Length)
String_Name
MID 0 Start_Index
1
KHAstrResult1
101 |
40 SubString
ALIDstrResult2
Splitting
String Split
Split
Split
102 |
Concatening
&
FullName
Khalid ESSAADANILast_NameFirst_Name
String Concat
103 |
Last_Name First_Name FullName
Concat
Join
Space
StringJoin
MsgBox(Expression3)
104 |
Contains
Contains
False True
Contains
String
strText Contains
TrueContains
105 |
IndexOf
1IndexOf
106 |
Think
IndexOf
1
If strText.IndexOf("Manage") = -1 Then
MsgBox("Not Found :(")
Else
MsgBox("Word is Found at Index: " &
strText.IndexOf("Think"))
End If
IndexOf Manage
1
107 |
Replace
Replace
MsgBox(TrueText)
Replace
TrueText
Insert
Insert
108 |
MsgBox(FinalExpression)
0
FinalExpression
Compare
Compare
0 CompareTo
1
If Result = 0 Then
MsgBox(")"
109 |
Else
MsgBox(")"
End If
'
Result = First_String.CompareTo(Second_String)
If Result = 0 Then
MsgBox(")"
Else
MsgBox(")"
End If
Format
String Format
Format
Format
110 |
Format
Format
111 |
Format
c
Currency
Format
112 |
- Model: {1}
- Qty: {2}
- Amount: {3:c}", Name,
Model, Quantity, Amount))
Amount
Format#
113 |
0 #
114 |
Dim Amount As Double = 45612.5
MsgBox(String.Format("{0:000 000.00}", Amount))
Format
Dated
Now()
115 |
CurrentDate
Format Date
d
'
MsgBox(String.Format("{0:d}", CurrentDate))
'
MsgBox(String.Format("{0:dd/MM}", CurrentDate))
'
MsgBox(String.Format("{0:dd}", CurrentDate))
'
MsgBox(String.Format("{0:MM/yyyy}", CurrentDate))
116 |
'
MsgBox(String.Format("{0:yyyy}", CurrentDate))
'
MsgBox(String.Format("{0:yyyy/MM/dd}", CurrentDate))
'
MsgBox(String.Format("{0:ss:mm:hh - yyyy/MM/dd}",
CurrentDate))
'
MsgBox(String.Format("{0:ss}", CurrentDate))
'
MsgBox(String.Format("{0:mm}", CurrentDate))
'
MsgBox(String.Format("{0:hh}", CurrentDate))
'
MsgBox(String.Format("{0:ss:mm:hh}", CurrentDate))
'
MsgBox(String.Format("{0:mm:hh}", CurrentDate))
'
MsgBox(String.Format("{0:d}", CurrentDate))
117 |
'
MsgBox(String.Format("{0:dd/MM}", CurrentDate))
'
MsgBox(String.Format("{0:dd}", CurrentDate))
118 |
'
MsgBox(String.Format("{0:MM/yyyy}", CurrentDate))
'
MsgBox(String.Format("{0:yyyy}", CurrentDate))
'
MsgBox(String.Format("{0:yyyy/MM/dd}", CurrentDate))
119 |
'
MsgBox(String.Format("{0:ss:mm:hh - yyyy/MM/dd}",
CurrentDate))
'
MsgBox(String.Format("{0:ss}", CurrentDate))
120 |
'
MsgBox(String.Format("{0:mm}", CurrentDate))
'
MsgBox(String.Format("{0:hh}", CurrentDate))
121 |
'
MsgBox(String.Format("{0:ss:mm:hh}", CurrentDate))
'
MsgBox(String.Format("{0:mm:hh}", CurrentDate))
122 |
Functions and Procedures
Function Procedure
Sub
ByRefByVal
123 |
lblName Label
txtName TextBox
btnShow Button
Public Class Form1
124 |
Name ShowMessage
Click
btnShow
ShowMessage
txtName
ShowMessage(txtName.Text)
End Sub
ShowMessage Name
125 |
btnShow
126 |
Functions
Function
lblNumber1 Label
lblNumber2 Label
lblChoose Label
txtNumber1 TextBox
txtNumber2 TextBox
rbAdd RadiButton
rbSubs RadiButton
rbMul RadiButton
127 |
rbDiv RadiButton
btnCalculate Button
End Function
Function Calculate
Double
Double Result
128 |
Number2Number1
Result
btnCalculateClick
N1 = Val(txtNumber1.Text)
N2 = Val(txtNumber2.Text)
N1
N2 txtNumber1
Result txtNumber2
Calcuate
129 |
End Sub
130 |
131 |
ByRef ByVal
By Value
Copy
By Reference
Number
2
132 |
502 25Number
By Referenece
Click
'
MsgBox(" : " & Number)
'
CalcByVal(Number)
'
MsgBox(" & " Number)
'
CalcByRef(Number)
'
MsgBox(" : " & Number)
133 |
16 Number
16
'
MsgBox(" : " & Number)
16
'
CalcByVal(Number)
Number CalcByVal
16
16 * 2 16 Number
32
134 |
'
MsgBox(" & " Number)
16
16
'
CalcByRef(Number)
Number
Number 16 32 16 * 2 CalcByRef
.32
'
MsgBox(" : " & Number)
32
3216
135 |
By Value
136 |
By Reference
137 |
Exceptions Handling
Runtime
lblAge Label
txtAge TextBox
btnShow Button
*
2
btnShow
138 |
Private Sub btnShow_Click(sender As Object, e As
EventArgs) Handles btnShow.Click
End Sub
Age
Invalid Cast
139 |
Invalid Cast Exception
TryCatchFinally
Try
'
Catch ex As Exception
'
Finally
'
End Try
Try
Catch
140 |
Finally
TryCatch
CatchTry
Try
Catch ex As Exception
MsgBox(")"
txtAge.Clear()
txtAge.Focus()
Finally
MsgBox(")"
End Try
Try
141 |
Dim Age As Integer = txtAge.Text
Catch ex As Exception
MsgBox(")"
txtAge.Clear()
txtAge.Focus()
Exception ex
Exception InvalidCastException
Focus
Finally
MsgBox(")"
End Try
142 |
Finally
Catch
143 |
Unstructured Exception Handling
On Error
'
On Error GoTo Label
Label: '
'
On Error Resume Next
'
On Error GoTo Label
Label
ErrorMessage:
MsgBox(")"
144 |
On Error
ErrorMessage
ErrorMessage
GoTo Label
GoTo
145 |
146 |
2015
Object Oriented Programming
mobarmijoun@gmail.com
how2progspace@gmail.com
www.mobarmjoun.com
www.youtube.com/EssaadaniTV
www.facebook.com/EssaadaniPage
147 |