创建,修改和删除文本文件 [英] Create,Modify and Delete a text file

查看:128
本文介绍了创建,修改和删除文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我是Silverlight的开始

这是我的代码

hi every body

iam the started of silverlight

this is my code

string path = @"F:\MyTest.txt";
                if (!File.Exists(path))
                {
                    // Create a file to write to.
                    using (StreamWriter sw = File.CreateText(path))
                    {
                        sw.WriteLine("Hello");
                        sw.WriteLine("And");
                        sw.WriteLine("Welcome");
                    }

                }




因此,IAM创建了一个文本文件,但返回错误




so iam creating a text file but it''s return error

[FileSecurityState_OperationNotPermitted]
Arguments: F:\MyTest.txt
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.0.60401.00&File=mscorlib.dll&Key=FileSecurityState_OperationNotPermitted




我能知道我在戴什么吗?

感谢和前进.......




can i know wehre i worng?

thanks and advance................

推荐答案

好吧,我以前从未编程过Silverlight应用程序,但据我了解,出于安全原因,不允许Silverlight应用程序shuold访问客户端的文件系统.

您要开始在Silverlight中编程还是要同时开始使用C#编写应用程序或同时开始使用两者编写代码?
Well, I never programmed a Silverlight app before, but in my understanding, a Silverlight app shuold not be allowed to access the filesystem on client side because of security reasons.

Do you want to start programming in Silverlight or do you want to start writing apps in C# or both at the same time?


这篇关于创建,修改和删除文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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