Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

generate random 10 chars

Featured Replies

Posted

Hi,

I was looking to generate unlimited 10 chars random numbers in vb.net. I found that it is not possible to set a variable to a certain lenght in the new vb.net, acoording a lot of coding sites. When I thought it worked it also started generating 8 and 9 chars of lenght. So, after a little while I came up with this:

Imports System.TextPublic Class Form1    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click        Dim startIndex As New String("1234567890")
Dim random As New Random
Dim startIndex1 As New String("0987654321")
Dim random1 As New Random
startIndex = random.Next(startIndex)
startIndex1 = random1.Next(startIndex1)
Dim str1 As String = startIndex
Dim str2 As String = startIndex1
Dim str3 As String = (str1 + str2).Substring(0, 10)
TextBox2.Text = str3
End Sub
End Class

This makes 2 strings str1 and str2, concentate them (str3)and take with Substring(0, 10) the wanted chars exact(10) all the time without exceptions. This is also a lot faster then generating with only 1 startIndex.

Btw: I want be spamming the shoutbox, ....... I am banned. I guess I deserved this.

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.