开发者

Attempt to access the method failed: System.IO.StreamWriter..ctor(System.String, Boolean)

开发者 https://www.devze.com 2023-01-04 23:13 出处:网络
I need to write string to an xml file in Silverlight. When I used the following code, the above mentioned exception \"Attempt to access the method failed: System.IO.StreamWriter..ctor(System.String, B

I need to write string to an xml file in Silverlight. When I used the following code, the above mentioned exception "Attempt to access the method failed: System.IO.StreamWriter..ctor(System.String, Boolean)" has occurred.

using (StreamWriter sw = new StreamWriter("C:\T开发者_如何学JAVAest.xml", false)) { sw.Write(root.ToString()); }

Can anyone help me out in doing writing to xml file in Silverlight?


Silverlight is in a sandboxed mode where it has restricted access. You can write to "Isolated Storage", but you cannot create files on their hard drive.

http://msdn.microsoft.com/en-us/library/system.io.isolatedstorage.isolatedstoragefile(VS.95).aspx

http://forums.silverlight.net/forums/p/22011/77243.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消