?
Solved

text file import into a text control

Posted on 2006-06-08
6
Medium Priority
?
209 Views
Last Modified: 2010-04-16
Hi Guys,
             I need to be able to see a csv or txt file in a control the way we see it in NotePad or WordPad. Any ideas??

Thank you!
Serge
0
Comment
Question by:Autofreak
  • 3
  • 2
6 Comments
 
LVL 6

Accepted Solution

by:
neilprice earned 500 total points
ID: 16862114

Hi Serge,

Try this;

Using System.IO;

...
System.IO.StreamReader sr = new System.IO.StreamReader("<your file name here>");
textBox1.Text = sr.ReadToEnd();
...

Hope it helps!
Neil
0
 
LVL 6

Expert Comment

by:MuhammadAdil
ID: 16862304
0
 

Author Comment

by:Autofreak
ID: 16862609
Excellent Man, only I have used a richTextBox, textBox behaves as if it had a length limit for the string it displays and richTextBox doesn't.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 6

Expert Comment

by:neilprice
ID: 16862641
A TextBox has a MaxLength property which is probably the length limit you're hitting.
You can set this in the designer or in code to allow more input

Neil
0
 

Author Comment

by:Autofreak
ID: 16862752
Sorry Muhammadadil,
                         the article is awesome, thank you so much, sorry, but  I have already marked Neil's answer . I will make it up to you one day :)  I remember your articles about MDI forms. Hope to see your posts soon.

Regards
Serge
0
 

Author Comment

by:Autofreak
ID: 16862761
Thank you Neil,
talk to you soon
Serge
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

839 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