- ©«¤l
- 57
- ¥DÃD
- 7
- ºëµØ
- 3
- ¿n¤À
- 60
- ÂI¦W
- 0
- §@·~¨t²Î
- WINDOWSXP
- ³nÅ骩¥»
- 2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2011-4-9
|
[¤À¨É] Visual Basic ·s¤â±Ð¾Ç ¤§¹Bºâ¤l
¥»©«³Ì«á¥Ñ §b§b ©ó 2010-9-25 02:06 ½s¿è
¦bµ{¦¡»y¨¥¤¤,¹Bºâ¤lºâ¬O¦U¬Û·í±`¥Î¨ìªº,µL½×¦p¦ó,¤£¥i¯à¼g¤@½ú¤lªº Hello World,¦]¦¹¤@©w·|¥Î¨ì¹Bºâ¤l
¥H¤UÂk¯Ç¤F´XºØ¹Bºâ¤l
- ºâ¼Æ¹Bºâ¤l
- ³sµ²¹Bºâ¤l
- ¤ñ¸û¹Bºâ¤l
- ÅÞ¿è¹Bºâ¤l
- ¦ì¤¸¹Bºâ¤l
ºâ¼Æ¹Bºâ¤l
- + ³oÓ¤£¥Î»¡¤F§a,´N¬O¥[¸¹,¨Ò¦p 3+5 = 8
- - ³oӲŸ¹¤]¬O¬Û·í´¶¹M,´N¬O´î¸¹ ¨Ò¦p 5-3 = 2 ¥t¥~¤@¼h·N¸q´N¬Ot¸¹ ¨Ò¦p-2
- * ³oӲŸ¹´N¬O¼Æ¾Ç¤Wªº¼¸¹,¨Ò¦p 3*5 = 15
- / ³oӲŸ¹¬O¼Æ¾Ç¤Wªº°£¸¹ ¨Ò¦p 10/8 = 1.25
- \ ³oӲŸ¹¬O¾ã¼Æ°£¸¹,¤]´N¬O¤G¼Æ¬Û°£®É¥u¨D¾ã¼Æªº°ÓÈ ¨Ò¦p 20\3 = 6
- mod ³oӲŸ¹¬O¨D¾l¼Æ ¨Ò¦p 18 mod 7 ¨äµ²ªG¬°4
- ^ ³oӲŸ¹¬O«ü¼Æ¹Bºâ²Å¸¹ ¨Ò¦p 3^4 ´N¬O 3*3*3*3=81
¤ñ¸û¹Bºâ¤l
©Ò¿×¤ñ¸û¹Bºâ¤lÅU¦W«ä·N´N¬O¤GÓȩΪ«¥ó¤¬¬Û¤ñ¸û,©Ò¥H¤@¯ë³£·|¦^¶Ç true ©Î False
- = ¤ñ¸û¤GȬO§_¬Ûµ¥ ¨Ò¦p MessageBox.Show((3 = 8).ToString()) ¦^¶Ç False
- < ©M¼Æ¾Ç¤Wªº¤p©ó¦P¸q ¨Ò¦p MessageBox.Show((3 < 8).ToString()) ¦^¶Ç True
- > ©M¼Æ¾Ç¤Wªº¤j©ó¦P¸q ¨Ò¦p MessageBox.Show((3 > 8).ToString()) ¦^¶Ç False
- >= ¤j©ó©Îµ¥©ó ¨Ò¦p MessageBox.Show((3 >= 8).ToString()) ¦^¶Ç False
- <= ¤p©ó©Îµ¥©ó¨Ò¦p MessageBox.Show((8 <= 8).ToString()) ¦^¶Ç True
- <> ¤£µ¥©ó ¨Ò¦p MessageBox.Show((3 <> 8).ToString()) ¦^¶Ç True
- Is ¤ñ¸û¤Gª«¥ó¬O§_¬Û¦P¬°¦P¤@ª«¥ó¥ó,¨Ò¦p
- Public Class Form1
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim A As New Button
- Dim b As New Button
- MessageBox.Show((A Is b).ToString)
- End Sub
- End Class
½Æ»s¥N½X ³oÓµª®×¬OFalse , ªí¥Ü a ©Mb ¬O¤GÓÓ¦Û¿W¥ßªº«ö¶s
¦ý¦pªG¬O- Public Class Form1
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim A As New Button
- Dim b As Button = A
- MessageBox.Show((A Is b).ToString)
- End Sub
- End Class
½Æ»s¥N½X ªí¥Üa©Mb¬O¬Û¦Pªºªºª«¥ó,©Ò¥H¦^¶Çtrue,Y¥H¦ì§}ªºÃö«Y¨Ó¬Ý,²Ä¤@Óµ{¦¡a©Mbªº¦ì§}¤£¦P,¦ý²Ä¤GÓµ{¦¡¤¤a©Mb«ü¦V¦P¤@Ó¦ì§}
- TypeOf.......Is
¤@¯ë¦Ó¨¥³oӥΨӬd¬Ý¬O§_¬YÓª«¥ó²Å¦X¬Y¤@«¬ºA,¦pªG¬Oªº¸Ü´N¥i¥H¶i¦æÂà´«,¦]¬°¦bVb.net¼g§@®É§Æ±æ¹F¨ì±j«¬§Oªºn¨D,³o¼Ë¥i¥H¼W¥[µ{¦¡½Xªº¦w¥þ©Ê
¨Ò¦p- Public Class Form1
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- If TypeOf sender Is Button Then
- MessageBox.Show(DirectCast(sender, Button).Text)
- End If
- End Sub
- End Class
½Æ»s¥N½X - Like Like ¹Bºâ¤l¤@¯ë¥Î¦b¦r¦êªº«¬¦¡¤ñ¸û¨Ò¦p
MessageBox.Show("F" Like "[A-Z]") ¦^¶ÇTrue ¦]¬°F¬°A-Z¨ä¤¤¤§¤@¦r¤¸
·íµM§ÚÌ¥i¥H¬¡¥Î±qdos®É¥N´N¯d¤U¨Óªº¸U¥Î¦r¤¸¦p¥H¤U¤]¬O¦^¶Çtrue
MessageBox.Show("Casting" Like "Ca?t*")
*¥Nªíªº¬O¤@¦ê¦r,¦Ó?¥Nªíªº¬O¤@Ó¦r¤¸
«ü©w¹Bºâ¤l ¤ñ¸û¤£¦P©ó¼Æ¾Ç¤Wªºµ¥¸¹ ³o¸Ìªº·N«ä¬O «ü©w¬Y¤@Óȵ¹¬Y¤@ÅܼÆ
¦p X= 1, ¥Nªíªº·N«ä¬O ±N1«ü©wµ¹X,¦Ó¤£¬OX µ¥©ó1 ¦]¦¹·|¦³ X = X+1 ³o¼Ëªº³¯z ±N X 쥻¥[1«á¦A«ü©wµ¹X
³sµ²¹Bºâ¤l VB¤¤¦r¦êªº³sµ²¥i¥H¦³¤GÓ¹Bºâ¤l¨Ï¥Î,¤@Ó¬O§Q¥Î+ ,¥t¤@Ó¬O &
MessageBox.Show("abc" + "def")
MessageBox.Show("abc" & "def")
¬°µ¥¿é¥X
ÅÞ¿è¹Bºâ¤l
Not : ¨Ò¦p
Dim A As Boolean = False
MessageBox.Show(Not A).ToString()
«h·|Åã¥Ü¥X true , ¤]´N¬O©Mì¥ýȬۤϪº·N«ä
Xor
¥u¦³·í A ©M B³£¬Ofalse ©Î ¬O ³£¬O true®É ¤~·|¬Ofalse
¨ä¾l³£¬Otrue
And
·í A ©M B³£¬O true ®É ¤~·|¬O true ¨ä¾l³£¬O False
Or
·íA©MB ¥ô¤@Ó¬Otrue®É´N¬Otrue
AndAlso
©MAndªº®ÄªG¬O¤@¼Ë,¦ý®Ä²v¤£¦P,ì¦]¦b©óandalso¥un§P©w«e±¤@Ó¬Ofalse´N¤£·|¥h§PÂ_¤U¤@Óª½±µ´N¦^À³false,µM¦Ó and ¬O·| A ©MB ³£§PÂ_§¹¦¨¤F,¤~·|¥h¦^À³ |
|