Beispiel #1
0
        static void Main()
        {
            FileHandle file = new FileHandle();


            Console.WriteLine("Change structure to read only");
            file.OpenForRead("C:/ReadOnlyFiles/ ");
            Console.WriteLine("FileSize: " + file.FileSize + " FileName: " + file.FileName);
            Console.WriteLine("FilePath: " + file.FilePath + " FileAccessType: " + file.FileAccessType);


            Console.WriteLine("\nChange structure to write only");
            file.OpenForWrite("C:/WriteOnlyFiles/ ");
            Console.WriteLine("FileSize: " + file.FileSize + " FileName: " + file.FileName);
            Console.WriteLine("FilePath: " + file.FilePath + " FileAccessType: " + file.FileAccessType);

            Console.WriteLine("\nSpecify what you want to do with file:");
            var fileaccesstype = Console.ReadLine();

            file.OpenForSpecified("C:/AllFiles/ ", fileaccesstype);
            Console.WriteLine("FileSize: " + file.FileSize + " FileName: " + file.FileName);
            Console.WriteLine("FilePath: " + file.FilePath + " FileAccessType: " + file.FileAccessType);

            Console.WriteLine("\nChange structure to readwrite");
            file.OpenReadWrite("C:/ReadAndWriteFiles/ ");
            Console.WriteLine("FileSize: " + file.FileSize + " FileName: " + file.FileName);
            Console.WriteLine("FilePath: " + file.FilePath + " FileAccessType: " + file.FileAccessType.ToString());
        }