ReadExistingTextFile() 공개 정적인 메소드

public static ReadExistingTextFile ( string fileName ) : string
fileName string
리턴 string
예제 #1
0
        private bool WaitForBackupCompletion()
        {
            Assert.IsNotNull(_application);

            for (int i = 0; i < 40; i++)
            {
                try
                {
                    string logFile = _application.Settings.Backup.LogFile;

                    string contents = Utilities.ReadExistingTextFile(logFile);

                    if (contents.IndexOf("Backup completed successfully") > 0)
                    {
                        return(true);
                    }

                    if (contents.IndexOf("BACKUP ERROR:") > 0)
                    {
                        return(false);
                    }
                }
                catch (Exception)
                {
                    // probably a share access violation.
                }

                Thread.Sleep(250);
            }

            return(false);
        }