Solved

unix2dos with .net

Posted on 2013-01-23
5
327 Views
Last Modified: 2013-01-23
I have some code that is getting output from a Linux script and I display it in a textbox.  How can I convert this to display correctly on my screen?  I would like to do this without having to write the file out.  Can I do a unix2dos conversion in .net?
0
Comment
Question by:chadmanvb
5 Comments
 
LVL 42

Expert Comment

by:sedgwick
Comment Utility
can u post an example?
0
 

Author Comment

by:chadmanvb
Comment Utility
When I display the output into a text box it does not see the correct line breaks.  It looks and shows up as one long line. It should only show 2 lines and line up the columns.
0
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 500 total points
Comment Utility
The problem with this usually is in the different line endings. To convert the unix 'linefeed-only' to the dos/windows 'cr/lf' you can use:
TextBox1.Text = strUnixText.Replace(vbLf, vbCrLf)

Open in new window

0
 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
Also, set the Multiline property of textbox to true and increase its height.
0
 

Author Closing Comment

by:chadmanvb
Comment Utility
That did it!  Thanks.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 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

16 Experts available now in Live!

Get 1:1 Help Now