

























VB.NET
Public Function GetRandomNumber(Optional ByVal Low As Integer = 1, Optional ByVal High As Integer = 100) As Integer
Dim oRandom As System.Random
oRandom = New System.Random(CType(System.DateTime.Now.Ticks Mod System.Int32.MaxValue, Integer))
Return oRandom.Next(Low, High + 1)
End Function
C#
省略
示例代码:
Response.Write(GetRandomNumber(1.6))
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。