[英]VB silverlight for windows phone “System.IO”
hello i am having an error : "Attempt to access the method failed: System.IO.File.Exists(System.String)" 你好,我遇到一个错误:“尝试访问该方法失败:System.IO.File.Exists(System.String)”
i have to note that this line is having an external url 我必须注意,这行有一个外部网址
If File.Exists("http://www.demo.com/demo.xml") Then blah end if
during my first try it worked but now it seems bugy :S it does not make sense ! 在我的第一次尝试中,它奏效了,但现在似乎有问题:S这没有任何意义!
It sounds like you should be making a web request (eg with WebClient
) instead. 听起来您应该发出Web请求(例如,使用
WebClient
)。
You're using File.Exists
and passing it a URL. 您正在使用
File.Exists
并将其传递给URL。 File.Exists
is meant to be for file system paths. File.Exists
用于文件系统路径。 In fact, you're not meant to call File.Exists
at all on Windows Phone 7. When in doubt, consult the documentation : 实际上,您根本
File.Exists
在Windows Phone 7上调用File.Exists
。如有疑问,请查阅文档 :
This member has a SecurityCriticalAttribute attribute on Silverlight for Windows Phone, because the attribute was present in Silverlight 3. This attribute restricts this member to internal use.
该成员在Silverlight for Windows Phone上具有SecurityCriticalAttribute属性,因为该属性存在于Silverlight 3中。此属性将其限制为内部使用。 Application code that uses this member throws a MethodAccessException.
使用此成员的应用程序代码将引发MethodAccessException。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.