コード例 #1
0
        static void Main(string[] args)
        {
            double slow = PerformanceDemo.SlowPerformance();
            double fast = PerformanceDemo.FastPerformance();

            Console.WriteLine($"It took approx. {Math.Round(slow / fast, 0)} times as long to do it the SLOW way.");


            // Create a file in the local folder to write result to


            // Get a list of folders from a directory on disk


            // First, write the top-level folder


            // Find all the folders in this folder


            // Write this folder name to the text file


            // Go one level deeper

            // Write this folder name to the text file



            // The file is now closed.  We can open it again for append to add more lines

            Console.ReadLine();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            // Here are a few examples of reading in a file and writing out values
            // to demonstrate their value.
            //ReadingInFiles.ReadACharacterFile();
            //ReadingInFiles.ReadInACSVFile();
            //WritingTextFiles.WritingAFile();
            //LoopingCollectionToWriteFile.LoopingADictionaryToWriteAFile();
            //BinaryFileWriter.WritePrimitiveValues();
            //BinaryFileWriter.ReadPrimitiveValues();
            //ReadingAndWritingFiles.OpenAndWrite();
            //BinaryImageManipulator.ReadFileIn();
            PerformanceDemo.SlowPerformance();
            PerformanceDemo.FastPerformance();

            FileInfo f = new FileInfo(@"C:\Users\Katie Dwyer\BitBucket\c-main\module-1\18_FileIO_Writing_out\lecture-final\dotnet\Lecture\bin\Debug\netcoreapp2.1\fast-file.txt");

            Console.WriteLine($"{f.Name} was created at {f.CreationTime}");

            // Students find value in building something useful.
            // As a group you could build something that prompts the user for data and saves it to a file.
            // OR reads a file in and "processes" the data (geocoding?)

            Console.Write("Press enter to finish");
            Console.ReadLine();
        }
コード例 #3
0
        static void Main(string[] args)
        {
            string regular    = "this\nis\na\nstring\twith\nescape\ncharacters";
            string withAtSign = @"this\nis\na\nstring\twith\nescape\ncharacters";

            string path = @"C:\Users\Katie Dwyer\workspace\c-base\module-1\18_FileIO_Writing_out\lecture-final\dotnet\Lecture\bin\Debug\netcoreapp2.2";

            Console.WriteLine("Regular string: " + regular);
            Console.WriteLine("With @ sign: " + withAtSign);

            //HardCodePath();

            //FileAndDirectories.UsingTheDirectoryClass();

            WritingTextFiles.WritingAFile();
            WritingTextFiles.WritingAFileWithNoPath();

            PerformanceDemo.SlowPerformance();
            PerformanceDemo.FastPerformance();

            LoopingCollectionToWriteFile.LoopingADictionaryToWriteAFile();
            ReadingAndWritingFiles.OpenAndWrite();
            BinaryImageManipulator.ReadFileIn();

            FileWrite();

            Console.Write("Press enter to finish");
            Console.ReadLine();
        }
コード例 #4
0
 static void Main(string[] args)
 {
     // WritingTextFiles.WritingAFile();
     // LoopingCollectionToWriteFile.LoopingADictionaryToWriteAFile();
     // ReadingAndWritingFiles.OpenAndWrite();
     PerformanceDemo.FastPerformance();
     PerformanceDemo.SlowPerformance();
     Console.Write("Press enter to finish");
     Console.ReadLine();
 }
コード例 #5
0
ファイル: Program.cs プロジェクト: John-ley3/Class-Work
        static void Main(string[] args)
        {
            // Here are a few examples of reading in a file and writing out values
            // to demonstrate their value.
            //WritingTextFiles.WritingAFile();
            //LoopingCollectionToWriteFile.LoopingADictionaryToWriteAFile();
            //ReadingAndWritingFiles.OpenAndWrite();
            PerformanceDemo.SlowPerformance();
            PerformanceDemo.FastPerformance();


            Console.Write("Press enter to finish");
            Console.ReadLine();
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: dejancancar/dejancancar-c
        static void Main(string[] args)
        {
            // Here are a few examples of reading in a file and writing out values
            // to demonstrate their value.
            //WritingTextFiles.WritingAFile();
            //BinaryFileWriter.WritePrimitiveValues();
            //BinaryImageManipulator.FunWithPhoto();
            PerformanceDemo.SlowPerformance();
            PerformanceDemo.FastPerformance();


            Console.Write("Press enter to finish");
            Console.ReadLine();
        }
コード例 #7
0
        static void Main(string[] args)
        {
            // Here are a few examples of reading in a file and writing out values
            // to demonstrate their value.
            //ReadingInFiles.ReadACharacterFile();
            //ReadingInFiles.ReadInACSVFile();
            //WritingTextFiles.WritingAFile();
            //BinaryFileWriter.WritePrimitiveValues();
            //BinaryImageManipulator.FunWithPhoto();
            PerformanceDemo.SlowPerformance();
            PerformanceDemo.FastPerformance();

            //Console.WriteLine( SpecialFolders.GetUserFolder() );
            //SpecialFolders.ShowAllSpecialFolders();

            //BinaryImageManipulator.FunWithPhoto();

            // Students find value in building something useful.
            // As a group you could build something that prompts the user for data and saves it to a file.
            // OR reads a file in and "processes" the data (geocoding?)

            Console.Write("Press enter to finish");
            Console.ReadLine();
        }