0

I have a text file having randomize numbers.
->first read the file in asp.net
->then count how much time the number will repeated in that text file
->and also display the time taking to read the file

Please help if any body has the answer.

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by searchec
-1
private void LoopNumbers()  
        {  
            Random rand = new Random(DateTime.Now.Millisecond);  
            ArrayList aryList = new ArrayList();  
  
            for (int i = 0; i < 100; i++)  
            {                 
                int num = rand.Next(0, 1000);  
  
                if (!aryList.Contains(num))  
                    aryList.Add(num);  
                else  
                    i--;                  
            }  
  
            Response.Write("aryList.Count = " + aryList.Count.ToString() + "<br /><br />");  
  
            for (int i = 0; i < aryList.Count; i++)  
            {  
                Response.Write(aryList[i].ToString() + " ");  
            }  
        }

Follow this code,It may help you.

Edited by __avd: Added [code] tags.

Votes + Comments
Read forum rules please (:
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.