Azavea.NijPredictivePolicing.Common.FileUtilities.TryDelete C# (CSharp) Method

TryDelete() public static method

Delete without exceptions. Returns true on success, false on failure.
public static TryDelete ( string filename ) : bool
filename string
return bool
        public static bool TryDelete(string filename)
        {
            try
            {
                if (File.Exists(filename))
                    File.Delete(filename);

                return true;
            }
            catch { }
            return false;
        }