简体   繁体   English

c# 文件夹的 getFiles 上的“系统调用级别不正确”

[英]c# “the system call level is not correct” on getFiles of a folder

i need read all files txt in a folder on this address: 192.168.1.209\user\HST.我需要读取此地址文件夹中的所有文件 txt:192.168.1.209\user\HST。 This is my c# code:这是我的 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());
        }

This code get me this error: "the system call level is not correct".这段代码给我这个错误:“系统调用级别不正确”。 The strange thing is that if i read another file, for example: 192.168.1.201\user\HST it works.奇怪的是,如果我读取另一个文件,例如: 192.168.1.201\user\HST 它可以工作。

I would like to specify that i can see all files txt inside the folder.我想指定我可以看到文件夹内的所有文件 txt。 Another strange thing is that i can't see the size of the folder like this image: image1另一个奇怪的事情是我看不到像这张图片这样的文件夹的大小: image1

So, i ask you, how can i resolve this problem?所以,我问你,我该如何解决这个问题? How can i read files inside this folder?如何读取此文件夹中的文件? Is there a similar function that allows me to read all files?是否有类似的 function 允许我读取所有文件?

take a time to verify if花点时间验证是否

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

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