- ©«¤l
- 20
- ¥DÃD
- 18
- ºëµØ
- 0
- ¿n¤À
- 43
- ÂI¦W
- 0
- §@·~¨t²Î
- windows xp
- ³nÅ骩¥»
- Office 2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2011-9-5
- ³Ì«áµn¿ý
- 2011-9-6
|
VB.NET ±Ð¾Ç °ò¥»»yªk
IF
view sourceprint?01 Module TestIf
02 '¥Dµ{¦¡
03 Public Sub Main()
04 Dim i As Int32 = 60
05 If (i = 100) Then ' =,>=,<=,>,<,<>
06 System.Console.WriteLine(i.ToString() + " µ¥©ó100")'Code Black
07 Else
08 System.Console.WriteLine(i.ToString() + " ¤£µ¥©ó100") 'Code Black
09 End If
10 End Sub
11 End Module
SELECT CASE
view sourceprint?01 Module TestSelectCase
02 '¦h«¤À¤ä¬yµ{
03 Public Sub Main()
04 Dim i As OpMode = OpMode.Query
05 Select Case i
06 Case OpMode.Add
07 System.Console.WriteLine("·s¼W!!")
08 Case OpMode.Delete
09 Case OpMode.Modify
10 Case OpMode.Query
11 System.Console.WriteLine("¬d¸ß!!")
12 End Select
13 End Sub
14 End Module
view sourceprint?1 Public Class AppUtil
2
3 End Class
4 Public Enum OpMode
5 Add
6 Modify
7 Delete
8 Query
9 End Enum
view sourceprint?01 Module TestIfNested
02 Public Sub Main()
03 Dim i As Int32 = 59
04 If (i >= 60) Then
05 If (i >= 70) Then
06 If (i >= 80) Then
07
08 If (i >= 90) Then
09 System.Console.WriteLine("¦n¦¨ÁZ!")
10 Else
11 System.Console.WriteLine("¤£¿ù!!")
12 End If
13 Else
14 System.Console.WriteLine("´¶³q!!")
15 End If
16 Else
17 System.Console.WriteLine("¤Î®æÃä½t!")
18 End If
19 Else
20 System.Console.WriteLine("¤£¤Î®æ!!")
21 End If
22 End Sub
23 End Module
±_ª¬IF |
|