Solved

Need to readlines of a file stream

Posted on 2004-09-30
4
321 Views
Last Modified: 2008-01-09
I need to know how to easily store each line in the file i am opening into an array... Its easy to do using a StreamReader, is there a way to convert stream to streamreader???

openFileDialog1.InitialDirectory = "c:\\" ;
openFileDialog1.Filter = "MiPS files (*.mip)|*.mip|All files (*.*)|*.*" ;
openFileDialog1.FilterIndex = 2 ;
openFileDialog1.RestoreDirectory = true ;

if(openFileDialog1.ShowDialog() == DialogResult.OK)
{
if((myStream = openFileDialog1.OpenFile())!= null)
{
//get each line in the file and put in an array
}
0
Comment
Question by:Rowdyone52
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
AvonWyss earned 500 total points
ID: 12192673
StreamReader sr=new StreamReader(myStream)
0
 

Author Comment

by:Rowdyone52
ID: 12192692
goodness... should figured that one out!  thanks.
0
 
LVL 22

Expert Comment

by:_TAD_
ID: 12192720

Avon, are you passing points?

;-P
0
 
LVL 14

Expert Comment

by:AvonWyss
ID: 12193130
Well, that was easy enough ;-)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now