منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
لانشاء رقم عشوائي - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : الأقسام التعليمية - المنتدى القديم (http://vb4arb.com/vb/forumdisplay.php?fid=90)
+--- قسم : مكتبة أكواد المنتدى (http://vb4arb.com/vb/forumdisplay.php?fid=111)
+---- قسم : مكتبة أكواد .net (http://vb4arb.com/vb/forumdisplay.php?fid=117)
+---- الموضوع : لانشاء رقم عشوائي (/showthread.php?tid=6167)



لانشاء رقم عشوائي - RaggiTech - 17-10-12

كاتب الموضوع : AhmedEssawy

لانشاء رقم عشوائي في حدود مدي integer

كود :
'Instantiate the random class

Dim r As Random = New Random


'


'Get a random number within the full range of a integer value.


MsgBox(r.Next())
لانشاء رقم بين الصفر و العشرين

كود :
'Generates a random number from 0 up to the set maximum. It is

'set not to return a number larger than 20.


MsgBox(r.Next(20))
لانشاء رقم بين العشر و العشرين

كود :
'Generates a random number within the minumum and maximum

'numbers that are specified. IT will not return a number lower


'than the setMinumum, or return a number higher than the setMax.


MsgBox(r.Next(10, 15))