Azavea.NijPredictivePolicing.Common.FileUtilities.TryChangeLastWriteTime C# (CSharp) 메소드

TryChangeLastWriteTime() 공개 정적인 메소드

Try changing the file's last write time without exceptions. Returns true on success, false on failure.
public static TryChangeLastWriteTime ( string filename, System.DateTime newTime ) : bool
filename string
newTime System.DateTime
리턴 bool
        public static bool TryChangeLastWriteTime(string filename, DateTime newTime)
        {
            try
            {
                if (File.Exists(filename))
                {
                    File.SetLastWriteTime(filename, newTime);
                }

                return true;
            }
            catch { }
            return false;
        }