Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Preserving Whitespace

0 views
Skip to first unread message

Randy

unread,
Dec 22, 2003, 9:31:12 AM12/22/03
to
I have a webservice which reads a file into an array of
string. It then returns the array to the calling program.
The problem is that file contains a large amount white
space which is used for formatting. I can't seem to figure
out how to preserve this formatting. The code is very
simple, see below. I guess I'm just wondering do I need to
do an XML transform before I leave the function, and then
have the function return an array of XLM?

Any help would be greatly appreciated.

Public Function GetFile(ByVal JobName As String, ByVal
FileName As String)

{I have left out where I determine the directory structure
on the server for finding the file based oon the first
parameter passed into the funtion. }

Dim FS As New FileStream(sTempStr, FileMode.Open,
FileAccess.Read)
Dim Reader As New StreamReader(FS)

Dim Contents() As String = New String(5000) {}

x = 0

While Reader.Peek <> -1
Contents(x) = Reader.ReadLine
x += 1
End While

Reader.Close()
FS.Close()

Return Contents

0 new messages