Torna al Thread

private void loadDictBut_Click(object sender, EventArgs e) // apre un form e legge il percorso del file.txt { FormDict fd = new FormDict(); DialogResult result = fd.ShowDialog(); if (result == DialogResult.OK) { path = fd.path; } } private void randomWordBut_Click(object sender, EventArgs e) { int numParole, d = 0; dict = new string[2]; Random rand = new Random((int)DateTime.Now.Millisecond); StreamReader sr = new StreamReader(path); numParole = dict.GetLength(d); dict = File.ReadAllLines(path); numParole = dict.Length; nRand = rand.Next(0, numParole - 1); wordBack = dict[nRand].ToUpper(); _setWord(); }
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5