also der folgende c# code funktioniert ... ist im prinzip 1 zu 1 nach VB portierbar. ich werde jedenfalls mir nicht vb installieren.
Code:
public partial class Form1 : Form {
protected Random rnd;
public Form1() {
InitializeComponent();
this.rnd = new Random();
}
private void button1_Click(object sender, EventArgs e) {
List<String> keyList = new List<string>();
keyList.Add("1325");
for (int i = 0; i < 5; i++) {
keyList.Add(Random4StelligeZahl());
}
this.textBox1.Text = String.Join("-", keyList.ToArray());
}
protected String Random4StelligeZahl() {
String res = "";
for (int i = 0; i < 4; i++) {
res += this.rnd.Next(0, 9).ToString();
}
return res;
}
}