写入文本文件的最佳方式? [英] Best way to write to textfiles?

查看:46
本文介绍了写入文本文件的最佳方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




写文本文件的最佳方法是什么,是使用FileSystemObject还是使用StreamWriter



谢谢/ Nettan

Hi

What is the best way to write to a textfile, is it with FileSystemObject or
with StreamWriter?

Thanks /Nettan

推荐答案

Nettan写道:
Nettan wrote:

什么是写入文本文件的最佳方式是使用FileSystemObject还是使用StreamWriter获取

What is the best way to write to a textfile, is it with FileSystemObject or
with StreamWriter?



StreamWriter。绝对。


FileSystemObject充其量只是ASP的一个微弱的拐杖,它没有任何其他方式进入文件系统。


System.IO命名空间中的功能简单地将FSO吹走。


问候,

Phill W.

StreamWriter. Absolutely.

The FileSystemObject was, at best, a feeble crutch for ASP, which didn''t
have any other way of getting into the file system.

The functionality in the System.IO Namespace simply blows the FSO away.

Regards,
Phill W.


Phill W.写道:
Phill W. wrote:

>什么是写入文本文件的最佳方式是使用/或FileSystemObject还是使用StreamWriter?
>What is the best way to write to a textfile, is it with
FileSystemObject or with StreamWriter?



StreamWriter。绝对。


StreamWriter. Absolutely.



或者在VB2005中,我更喜欢IO.File.WriteAllText和IO.File.AppendAllText,其中
将大多数文本文件操作减少到一行代码。


-

(O)enone

Or in VB2005, I prefer IO.File.WriteAllText and IO.File.AppendAllText, which
reduces most textfile operations to one line of code.

--

(O)enone


" Phill W. < p -.- a-.-ward@open-.-ac-.-u-kschrieb:
"Phill W." <p-.-a-.-w-a-r-d@o-p-e-n-.-a-c-.-u-kschrieb:

>写入文本文件的最佳方法是使用FileSystemObject
还是使用StreamWriter?
>What is the best way to write to a textfile, is it with FileSystemObject
or with StreamWriter?



StreamWriter。绝对。


FileSystemObject充其量只是ASP的一个微弱的拐杖,它没有任何其他方式进入文件系统。


System.IO命名空间中的功能简单地将FSO吹掉。


StreamWriter. Absolutely.

The FileSystemObject was, at best, a feeble crutch for ASP, which didn''t
have any other way of getting into the file system.

The functionality in the System.IO Namespace simply blows the FSO away.



这是真的,除了我将继续在项目中使用FSO

从VB6迁移到代码被重写。


-

MS Herfried K. Wagner

MVP< URL:http:// dotnet。 mvps.org/>

VB< URL:http://dotnet.mvps.org/dotnet/faqs/>

That''s true, with the exception that I''d continue to use the FSO in projects
migrated from VB6 until the code gets rewritten.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

这篇关于写入文本文件的最佳方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆