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.
相关阅读
国女还是很牛的有什么 JavaScript 可以监控记录用户访问网站的所有行 (转载)[bssd]通天塔图书馆请教Lambda的问题numpy有polyfit, 有没有直接的函数返回polyfit的误差论坛是大宇宙,微信是小宇宙[bssd]Dallas capital one招人微信为啥不能修改原帖?reddit ceo 要和网球选手结婚了。手机ocr开源的开发工具哪家最好? 哪有范例或教程? 谢谢【转】 FYI 业内人士评一下这篇python question?还真有ai天气预报的被docker气死了单机版的人脸识别有同学注册了斯坦福的在线CS246--数据挖掘课程的吗如果今天重新开始搞一个论坛,还有需求吗?成为一名高手程序员是怎么样一种感受 (转载).net里面有对应Spring等的东西吗求推荐网上的数据库的课程