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
spencer20012
NA
20
0
reading text files into array
Mar 21 2004 3:20 PM
i have a text file with a list of values. i need to read them into an array in visual studio in a windows form. this is called form1.cs. I also have a class called TrafficSensor. see below. how can i read these values into an array in the form and print them into a label? cheers 4 any help! using System; using System.IO; namespace Workshop1 { public class TrafficSensor { private StreamReader inFile; private string fileText; public TrafficSensor(string trafficFile) { try { fileText="test"; inFile = new StreamReader(trafficFile); } catch (Exception e) { Console.WriteLine("Could open traffic simulator file. "+e); } } public string ReadTrafficSensor() { return fileText = inFile.ReadLine(); } } }
Reply
Answers (
1
)
Opening and Closing windows forms
how to control window?