Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Random from VFP to VB.NET
Message
From
05/11/2003 18:24:12
 
 
To
05/11/2003 17:25:32
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00846848
Message ID:
00846862
Views:
17
>I would like to convert this from VFP to VB.NET:
>
>
>ALLTRIM(TRANSFORM(INT(RAND()*10000000000000000000),'99999999999999999999'))
>
I did this.
   ' Return a random file name
   ' expC1 Start of the file name
   Private Function GenerateFileName(ByVal tcStart As String) As String
      Dim lnInteger As Integer
      Dim loRandom As New Random
      lnInteger = loRandom.NextDouble() * 1000000000
      Return tcStart + lnInteger.ToString().PadLeft(30, "0")
   End Function
This is as close as I can get as I cannot get a random number for such a big number in VB.NET. If someone could enhance that code, it'd be appreciated.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform