G*G
2 楼
in C#, you can use StreamWriter to write a file.
and you can use Filestream and StreamWriter to do the same thing.
What is differnce between the two methds?
for example,
A)
using (FileStream fs = new FileStream(fileName,FileMode.Append, FileAccess.
Write))
using (StreamWriter sw = new StreamWriter(fs))
{
sw.WriteLine(something);
}
B)
using (StreamWriter sw = new StreamWriter(fileName, true))
{
sw.WriteLine(something);
}
and you can use Filestream and StreamWriter to do the same thing.
What is differnce between the two methds?
for example,
A)
using (FileStream fs = new FileStream(fileName,FileMode.Append, FileAccess.
Write))
using (StreamWriter sw = new StreamWriter(fs))
{
sw.WriteLine(something);
}
B)
using (StreamWriter sw = new StreamWriter(fileName, true))
{
sw.WriteLine(something);
}
d*k
4 楼
用FileStream catch的 exception信息更全面吧。
H*S
6 楼
why dont you take a look at its source code ? I think underneath, `
StreamWriter` constructor that takes file name as argument will do a
conversion to `FileStream` and call the other constructor directly ?
StreamWriter` constructor that takes file name as argument will do a
conversion to `FileStream` and call the other constructor directly ?
x*g
7 楼
收钱的反而是假的,
a9
8 楼
FileStream是个raw stream
StreamWriter是外面包了层壳
【在 G***G 的大作中提到】
: in C#, you can use StreamWriter to write a file.
: and you can use Filestream and StreamWriter to do the same thing.
: What is differnce between the two methds?
: for example,
: A)
: using (FileStream fs = new FileStream(fileName,FileMode.Append, FileAccess.
: Write))
: using (StreamWriter sw = new StreamWriter(fs))
: {
: sw.WriteLine(something);
StreamWriter是外面包了层壳
【在 G***G 的大作中提到】
: in C#, you can use StreamWriter to write a file.
: and you can use Filestream and StreamWriter to do the same thing.
: What is differnce between the two methds?
: for example,
: A)
: using (FileStream fs = new FileStream(fileName,FileMode.Append, FileAccess.
: Write))
: using (StreamWriter sw = new StreamWriter(fs))
: {
: sw.WriteLine(something);
k*n
9 楼
no, 付钱给 Apple 买个 unlock 的 iPhone 是真的。
s*s
10 楼
apple's website in Australia has unlocked version for $799 Aus for 16G.
相关阅读
Vertx dependency injection 问题老年工程师关于std::vector的几个问题bihai的帖子彻底打消了我学cpp的念头应该读phd吗?deep learning领域 原创文章没几篇[bssd]whereismyGCU 是网络安全的?deep learning现在还是冰山一角set operation in c搞个啥开源项目With all I had said...从数据压缩角度理解CNN有多少人觉得这一波AI是忽悠?[bssd]科技对社会在国内正面作用还是非常大一个算法问题C# 3D library 求助平行妹妹的部长叔叔情人被控制了 (转载)[bssd]不要得罪python和数据科学家[bssd] Big data and investing操他妈谷歌gmail脑袋进屎了?zz 游戏直播或构成侵权