Avatar of zimmer9
Flag for United States of America

asked on 

How would you delay by 1 minute, the creation of a file generated using C# (.net programming) with VS2010?

Using C# code with VS2010, can you think of a way to allow 1 minute to elapse before creating the file generated in the last statement of the following snippet of code:

foreach (FileInfo file in parentDirectory.GetFiles())
                if (!string.Equals(file.Name, MyGlobals.BASE_FILE_Name + ".ard", StringComparison.InvariantCultureIgnoreCase) &&
                    !string.Equals(file.Name, "Thumbs.db") &&
                    !string.Equals(GetFileTitleOnly(file.Name), GetFileTitleOnly(currentRunningAssembly.ManifestModule.Name), StringComparison.InvariantCultureIgnoreCase))
                    StreamWriter sw1 = new StreamWriter(errorFilePath);
                    ProcessFile(file.FullName, sw1);                                    }

            // allow 1 minute to expire before generating the following file
            File.Open(MyGlobals.BASE_DIR + MyGlobals.BASE_FILE_Name + ".ard", FileMode.Create).Close();
C#.NET Programming

Avatar of undefined
Last Comment
Karrtik Iyer

8/22/2022 - Mon