简体   繁体   中英

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. This is my c# code:

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.

I would like to specify that i can see all files txt inside the folder. Another strange thing is that i can't see the size of the folder like this image: 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?

take a time to verify if

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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