本文介绍了StreamWriter.Write和WriteLine?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

使用

StreamWriter的Write或WriteLine方法,一行可以在文本文件中保存的最大长度是多少?如果字符串太长而无法保存一个

行,那么Write或WriteLine会做什么?为了让我以后从文本文件中正确检索数据

,我必须知道正确的索引。对于

后面的代码,如果str1的长度超过文本文件中的一行,那么在阅读文本文件时如何获得

str2'的索引?有没有办法处理这种

的情况?


///

dim sw as streamwriter

dim str1,str2 as string

sw.WriteLine(str1)

sw.WriteLine(str2)

\\ \\ /

感谢您的帮助。


Nina

Hi there,

What is the maximum length that one line can hold in a text file using
StreamWriter''s Write or WriteLine method? If the string is too long for one
line to hold, what will Write or WriteLine do? In order me to retrieve data
correctly from the text file later, I have to know the right index. For the
following code,if str1''s length exceeds one line in text file, how can I get
str2''s index when reading the text file? Is there any way to handle this
kind of situation?

///
dim sw as streamwriter
dim str1, str2 as string
sw.WriteLine(str1)
sw.WriteLine(str2)
\\\

I appreciate your help.

Nina

推荐答案






这篇关于StreamWriter.Write和WriteLine?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 17:22