About Asp.net

childlikenumberΑσφάλεια

4 Νοε 2013 (πριν από 3 χρόνια και 11 μήνες)

88 εμφανίσεις

About Asp.Net
Language Support
The Microsoft .NET Platform currently offers built-in support for three languages: C#,
Visual Basic, and Jscript but for this course we are going to work with VB.Net.

The following examples are provided to help you understand the code samples using
VB.Net.

• Variable Declarations

Dim x As Integer
Dim s As String
Dim s1, s2 As String
Dim o 'Implicitly Object
Dim obj As New Object()
Public name As String


• Comments

' This is a comment

' This
' is
' a
' multiline
' comment

• If Statements

If (Request.QueryString = Nothing)
...
End If


• Case Statements

Select Case FirstName
Case "John"
...
Case "Paul"
...
Case "Ringo"
...
Case Else
...
End Select

• For Loops

for (int i=0; i<3; i++)
a(i) = "test";
• While Loops
Dim I As Integer
I = 0
Do While I < 3
Console.WriteLine(I.ToString())
I += 1
Loop

• Arrays
Dim a(2) As String
a(0) = "1"
a(1) = "2"
a(2) = "3"

Dim a2(2,2) As String
a(0,0) = "1"
a(1,0) = "2"
a(2,0) = "3"