由于其保护级别,无法访问"System.IO.SearchOption" [英] 'System.IO.SearchOption' is inaccessible due to its protection level

查看:189
本文介绍了由于其保护级别,无法访问"System.IO.SearchOption"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Silverlight应用程序中,我使用了代码:::


string[] theFiles = Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.History), "*", SearchOption.AllDirectories);




在代码构建期间出现错误

错误:``System.IO.SearchOption''由于其保护级别而无法访问


现在,如果我想搜索历史记录文件怎么办,



:rose:
谨记
Er.Aashish Khandelwal

解决方案

无论您问多少次不同,最终结果都是相同的. Silverlight已沙盒化,您无法在浏览器中编写应用程序,并且期望它可以免费访问用户的硬盘驱动器.鉴于我所看到的当今外包行业正在发生的工作,如果不是这种情况,我将断开计算机与Internet的连接,或者至少需要每个在网页上工作的人的简历,在我考虑查看之前.当然,如果您不太可能成功完成业务并疯狂地寻求成功,那么Silverlight应用程序的用户将会震惊并发怒,发现您已删除了他们的所有cookie和浏览历史记录.

In silverlight application i used the code:::


string[] theFiles = Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.History), "*", SearchOption.AllDirectories);




during build of code i got error

ERROR::''System.IO.SearchOption'' is inaccessible due to its protection level


Now what to do if i wanna search history files,



:rose:
WITH REGARDS
Er.Aashish Khandelwal

解决方案

No matter how many times you ask this differently, the end result is the same. Silverlight is sandboxed, and you cannot write an app inside your browser, and expect it to have free access to your users hard drive. Given what I see of the sort of work happening in the outsourcing industry today, if that were not the case, I''d disconnect my computer from the internet, or at least require the bio of every person who worked on a web page, before I''d consider viewing it. Certainly, the users of your silverlight app, will be horrified and furious to find that you''ve deleted all their cookies and their browsing history, in the unlikely event that you succeed in your bizare and insane quest to do so.


这篇关于由于其保护级别,无法访问"System.IO.SearchOption"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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