2012-05-12 82 views
0

您好,我有一个错误: “尝试访问该方法失败:System.IO.File.Exists(System.String)”VB的Silverlight for Windows Phone支持 “System.IO”

我必须要注意这个线路是外部URL

If File.Exists("http://www.demo.com/demo.xml") Then blah end if

在我第一次尝试它的工作,但现在看来bugy:S 它没有任何意义!

回答

4

这听起来像你应该做一个Web请求(例如用WebClient)来代替。

您使用File.Exists和传递一个URL。 File.Exists意思是为文件系统路径。事实上,你是不是要叫File.Exists在所有的Windows Phone 7的疑问时,请咨询the documentation

这件具有用于Windows Phone的Silverlight的一个属性性SecurityCriticalAttribute,因为该属性是目前在Silverlight 3.此属性限制此成员内部使用。使用此成员的应用程序代码将引发MethodAccessException。

相关问题