Google グループは Usenet の新規の投稿と購読のサポートを終了しました。過去のコンテンツは引き続き閲覧できます。
Dismiss

Preserving Whitespace

閲覧: 0 回
最初の未読メッセージにスキップ

Randy

未読、
2003/12/22 9:31:122003/12/22
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 件