I need to convert some "Classic ASP 3.0" code into C# using ASP.NET:
Randomize() intUP = 9 intLow = 1 intRange = intUp - intLow intRandom = CInt ((intRange * Rnd()) + intLow) Response.Write(intRandom & "<br /><br />") for i = 1 to (num) + intRandom Response.Write(intRandom & "<br />") next And I have tried this code:
int count; Random rnd; protected void Page_Load(object sender, EventArgs e) { rnd = new Random(); count = GetRandomInt(1, 9); for (int i = 0; i < count; i++) { Response.Write(count.ToString()); } } protected int GetRandomInt(int min, int max) { return rnd.Next(min, max); } But in Classic ASP 3.0, the maximum output is 9, but in C# and ASP.NET, it is much higher.
What am I missing?
What's wrong with this code?
Thank you in advance.