Exemplo n.º 1
0
        public void DeleteFile(string path)
        {
            if (_sharpCifsFileSystem.IsEnabledForPath(path))
            {
                _sharpCifsFileSystem.DeleteFile(path);
                return;
            }

            SetAttributes(path, false, false);
            File.Delete(path);
        }
Exemplo n.º 2
0
        public void DeleteFile(string path)
        {
            if (_sharpCifsFileSystem.IsEnabledForPath(path))
            {
                _sharpCifsFileSystem.DeleteFile(path);
                return;
            }

            var fileInfo = GetFileInfo(path);

            if (fileInfo.Exists)
            {
                if (fileInfo.IsHidden)
                {
                    SetHidden(path, false);
                }
                if (fileInfo.IsReadOnly)
                {
                    SetReadOnly(path, false);
                }
            }

            File.Delete(path);
        }