TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Christopher
NA
1
0
simple loop..why strange results
Apr 23 2006 9:27 PM
I now know that I know nothing... using System; using System.IO; namespace ADODotNet { public class Class1 {public Random r = new Random(); string[] nodes = new string[] { "192.168.0.0", "192.168.0.1", "192.168.0.2", "192.168.0.3", "192.168.0.4", "192.168.0.5", "192.168.0.6", "192.168.0.7", "192.168.0.8", "192.168.0.9" }; public TextWriter tw = new StreamWriter("c:\\populate.txt"); [STAThread] public static void Main() { Class1 mc = new Class1(); for (int i = 0; i <= 299; i++) //mornin mc.putIP(); } public void putIP() { tw.Write(nodes[r.Next(10)]); tw.Write(" , "); tw.Write(tw.NewLine); } } } I thought I'd get 300 lines but instead I get 256...why
Reply
Answers (
1
)
I'm New Memeber In this Forums And I Need A Help
Is it a bug or Am i missing something?