Код Arduino хочет спецификатор вложенного имени перед System? - PullRequest
0 голосов
/ 03 мая 2018

Мой код начинается с "использование системы"; и, по-видимому, мне нужно спецификатор вложенного имени перед словом System. Я уже видел ответы на вопрос о том, что такое спецификатор вложенного имени, но должен сказать, что не понял ни одного слова. Вот цитата:

В неофициальном выражении, спецификатор вложенного имени является частью идентификатора,

  1. начинается либо в самом начале квалифицированного идентификатора, либо после оператора разрешения исходной области (: :), если он появляется в самом начале идентификатора, и
  2. заканчивается последним оператором разрешения области в квалифицированном идентификаторе.

Короче говоря, я понятия не имею, что теперь делать. Кто-нибудь может оказать здесь помощь?

Мой код:

using System;

namespace filemover
{
  public class SimpleFileCopy
  {
    static void Main()
    {
      string fileName = "test.txt";
        string sourcePath = "/Users/padmin/Documents/randomshit";
      string targetPath =  "/Users/padmin/Documents/randomshit/pdffiles";

      // Use Path class to manipulate file and directory paths.
      string sourceFile = System.IO.DirectoryInfo.GetFiles(sourcePath);
      string destFile = System.IO.Path.Combine(targetPath, fileName);

      // To copy a folder's contents to a new location:
      // Create a new target folder, if necessary.
      if (!System.IO.Directory.Exists(targetPath))
      {
         System.IO.Directory.CreateDirectory(targetPath);
      }

      // To copy a file to another location and 
      // overwrite the destination file if it already exists.
      System.IO.File.Copy(sourceFile, destFile, true);

      // To copy all the files in one directory to another directory.
      // Get the files in the source folder. (To recursively iterate through
      // all subfolders under the current directory, see
      // "How to: Iterate Through a Directory Tree.")
      // Note: Check for target path was performed previously
      //       in this code example.
      if (System.IO.Directory.Exists(sourcePath))
      {
        string[] files = System.IO.Directory.GetFiles(sourcePath);

        // Copy the files and overwrite destination files if they already exist.
        foreach (string s in files)
        {
          // Use static Path methods to extract only the file name from the path.
          fileName = System.IO.Path.GetFileName(s);
          destFile = System.IO.Path.Combine(targetPath, fileName);
          System.IO.File.Copy(s, destFile, true);
        }
      }
      else
      {
        Console.WriteLine("Source path does not exist!");
      }

      // Keep console window open in debug mode.
      Console.WriteLine("Press any key to exit.");
      Console.ReadKey();
    }
  }
}
...