Line Breaks in AddEntry(String, String)

Jun 10, 2010 at 3:07 PM
Edited Jun 10, 2010 at 3:08 PM

Hi I'm doing something similar to the asp.net example given and I'm trying to add a ReadMe.txt file from a string but its not doing the line breaks (new lines) properly.

The asp.net example uses AddFileFromString() but I see that that function no longer exists so I'm using AddEntry() instead.

 

String readmeText = String.Format("README.TXT\n\nThis is a sample ReadMe File created on {0}\n", System.DateTime.Now.ToString("G"));

...

zip.AddEntry("README.txt",readmeText);

 

However when I open the file its all on one line.

Thanks

 

EDIT: I'm using the Reduced Library if that makes any difference

Coordinator
Jun 14, 2010 at 11:27 PM

You may need to add \r before each \n , in the quoted string.

 

Jun 18, 2010 at 9:36 PM

Thanks.

That works, or also Environment.NewLine works as well.