silverlight 如何保存文件

如何将文本“HelloWorld”保存为myText.txt文件我使用了如下代码,IsolatedStorageFileisf=IsolatedStorageFile.G... 如何将文本“Hello World” 保存为myText.txt文件
我使用了如下代码,
IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication();
Stream stream = new IsolatedStorageFileStream("MyText.txt", System.IO.FileMode.Create, System.IO.FileAccess.Write, isf);
System.IO.TextWriter writer = new System.IO.StreamWriter(stream);
writer.Write("Hello World");
writer.Close(); // Close the writer so data is flushed
stream.Close();
可是无法保存成功,磁盘上没有这个文件。
展开
 我来答
miniappcwgg1p8e1w093
2011-02-17 · TA获得超过193个赞
知道小有建树答主
回答量:75
采纳率:0%
帮助的人:109万
展开全部
Stream stream = isf.CreateFile("MyText.txt");
...
writer.Flush();
writer.Close();
stream.Close();
试试看

btw我忘记是Create还是CreateFile了。。
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式