Solved

unix2dos with .net

Posted on 2013-01-23
5
337 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
ID: 38809751
can u post an example?
0
 

Author Comment

by:chadmanvb
ID: 38809911
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
ID: 38809922
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
ID: 38809973
Also, set the Multiline property of textbox to true and increase its height.
0
 

Author Closing Comment

by:chadmanvb
ID: 38810234
That did it!  Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

932 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

11 Experts available now in Live!

Get 1:1 Help Now