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.
相关阅读
如何run spark scala 代码,不用jar 的情况下?Kaggle速度好慢啊,还总掉线Julia没戏了Re: [bssd] 教小孩functional programming[bssd]改行秘籍[bssd]Python搞jit为什么这么难?围棋人工智能Master只用了一个GPU(转)少儿编程教育赛道大热,背后的资本较量这次支持王垠下Multi-tenancy Authentication 大家都怎么做?维护一个热门视频榜单的api小team政治scenario是不是我看错了,Kaggle上可做的题一共11题? (转载)wdong开始转型娱乐业了Delphi/Object Pascal杀回来了?现在下载电影最好的方式王垠又要回国了关于kuberbetes写GPU的汇编 - mission impossible各位师傅,能给推荐个软件license法律方面的好的介绍吗?