[英]Error deleting folder 'bin'. The system call level is not correct
[英]c# “the system call level is not correct” on getFiles of a folder
我需要讀取此地址文件夾中的所有文件 txt:192.168.1.209\user\HST。 這是我的 c# 代碼:
string str = "";
try
{
DirectoryInfo d = new DirectoryInfo(@"\\192.168.1.209\user\HST\");
FileInfo[] Files = d.GetFiles("*.txt");
foreach (FileInfo file in Files)
{
str = str + ", " + file.Name;
}
}
catch (Exception pp)
{
System.IO.File.WriteAllText(GlobalVariables.errorFolderLocation + "erroreLettura.1.209.txt", pp.ToString());
}
這段代碼給我這個錯誤:“系統調用級別不正確”。 奇怪的是,如果我讀取另一個文件,例如: 192.168.1.201\user\HST 它可以工作。
我想指定我可以看到文件夾內的所有文件 txt。 另一個奇怪的事情是我看不到像這張圖片這樣的文件夾的大小: image1
所以,我問你,我該如何解決這個問題? 如何讀取此文件夾中的文件? 是否有類似的 function 允許我讀取所有文件?
花點時間驗證是否
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.