Exemplo n.º 1
0
        public static void GetFileInfo(string path)
        {
            string   result = "";
            FileInfo file   = new FileInfo(path);

            if (file.Exists)
            {
                result += $"Размер: {file.Length} ";
                result += $"Расширение: {file.Extension} ";
                result += $"Имя файла: {file.Name} ";
                result += $"Дата создания: {file.CreationTime} ";
                result += $"Дата последнего изменения: {file.LastWriteTime} ";

                DVRLog.WriteInfo(result);
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            DVRLog test = new DVRLog(@"./../../../resources/tracked.txt");

            DVRDiskInfo.GetAllInfo();
            DVRFileInfo.GetFileInfo(@"./../../../results/DVRlogfile.txt");
            DVRDirInfo.GetAllInfo(@"./../../../../OOP_Lab13");
            DVRFileManager.ReadFilesAndDirs(@"F:\HDD\OOP_3sem");
            DVRFileManager.CreateCope(@"./../../../DVRInspect/DVRdirinfo.txt");
            DVRFileManager.DeleteFile(@"./../../../DVRInspect/DVRdirinfo.txt");
            DVRFileManager.CreateDir();
            //DVRFileManager.CopyFromUserDir(@"F:\HDD\OOP_3sem\OOP_3sem");
            //DVRFileManager.MoveDir();
            //DVRFileManager.CreateZip();
            DVRFileManager.ExtractZip();
            Console.ReadLine();
        }
Exemplo n.º 3
0
 public static void GetAllInfo(string path)
 {
     if (Directory.Exists(path))
     {
         DVRLog.WriteInfo("\n\n");
         DirectoryInfo   dirInfo = new DirectoryInfo(path);
         DirectoryInfo[] dirs    = dirInfo.GetDirectories();
         DVRLog.WriteInfo("Подкаталоги:");
         foreach (DirectoryInfo item in dirs)
         {
             DVRLog.WriteInfo(item.FullName);
         }
         DVRLog.WriteInfo($"Полное название каталога: {dirInfo.FullName}");
         DVRLog.WriteInfo($"Время создания каталога: {dirInfo.CreationTime}");
         DVRLog.WriteInfo($"Корневой каталог: {dirInfo.Root}");
         DVRLog.WriteInfo("\n\n");
     }
 }
Exemplo n.º 4
0
        public static void GetAllInfo()
        {
            string resultInfo = "";

            DriveInfo[] drives = DriveInfo.GetDrives();
            foreach (DriveInfo drive in drives)
            {
                resultInfo  = $"Название: {drive.Name}   ";
                resultInfo += $"Тип: {drive.DriveType}  ";

                if (drive.IsReady)
                {
                    resultInfo += $"Объем диска: {drive.TotalSize}  ";
                    resultInfo += $"Свободное место: {drive.TotalFreeSpace} ";
                    resultInfo += $"Метка: {drive.VolumeLabel}  ";
                }
                DVRLog.WriteInfo($"{resultInfo}");
            }
        }