简体   繁体   English

从我的电脑文件夹中获取所有Pdf文件

[英]Get All Pdf Files from My Computer Folder

I want to get all the PDF files from my MyComputer Folder. 我想从MyComputer文件夹中获取所有PDF文件。 I have written the code which is getting all of my drives successfully but there is an exception occurring and none of file is accessible. 我已经编写了成功获取所有驱动器的代码,但是发生了异常,没有文件可访问。 Here is the exception message. 这是异常消息。 Please help me for this. 请帮我。

"Access to the path 'C:\\$RECYCLE.BIN\\S-1-5-18' is denied." “拒绝访问路径'C:\\ $ RECYCLE.BIN \\ S-1-5-18'。”

My requirement is to get all the pdf files and their paths from My Computer folder. 我的要求是从“我的电脑”文件夹中获取所有pdf文件及其路径。

if you are running your C# program from visual studio: close VS and run it as administrator 如果您正在Visual Studio中运行C#程序:关闭VS并以管理员身份运行

if you are running your C# program alone from created .exe file in bin 如果要从bin中创建的.exe文件单独运行C#程序

try to run that as an administrator account 尝试以管理员帐户运行

I hope it'll be helpfull 希望对您有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM