コード例 #1
0
        private static bool Send(string path, FileOperationAPIWrapper.FileOperationFlags flags)
        {
            bool flag;
            try
            {
                FileOperationAPIWrapper.SHFILEOPSTRUCT sHFILEOPSTRUCT = new FileOperationAPIWrapper.SHFILEOPSTRUCT()
                {
                    wFunc = FileOperationAPIWrapper.FileOperationType.FO_DELETE,
                    pFrom = string.Concat(path, '\0', '\0'),
                    fFlags = (FileOperationAPIWrapper.FileOperationFlags)((ushort)(FileOperationAPIWrapper.FileOperationFlags.FOF_ALLOWUNDO | flags))
                };
                FileOperationAPIWrapper.SHFILEOPSTRUCT sHFILEOPSTRUCT1 = sHFILEOPSTRUCT;
                //FileOperationAPIWrapper.SHFileOperation(ref sHFILEOPSTRUCT1);
                flag = true;
            }
            catch (Exception)
            {
            #if DEBUG
                throw;
                System.Diagnostics.Debugger.Break();

            #endif
                flag = false;
            }
            return flag;
        }
コード例 #2
0
        private static bool Send(string path, FileOperationAPIWrapper.FileOperationFlags flags)
        {
            bool flag;
            try
            {
                flag = true;
            }
            catch (Exception)
            {
            #if DEBUG
                throw;
                System.Diagnostics.Debugger.Break();

            #endif
                flag = false;
            }
            return flag;
        }
		private static bool DeleteFile(string path, FileOperationAPIWrapper.FileOperationFlags flags)
		{
			bool result;
			try
			{
				FileOperationAPIWrapper.SHFILEOPSTRUCT sHFILEOPSTRUCT = new FileOperationAPIWrapper.SHFILEOPSTRUCT
				{
					wFunc = FileOperationAPIWrapper.FileOperationType.FO_DELETE,
					pFrom = path + '\0' + '\0',
					fFlags = flags
				};
				FileOperationAPIWrapper.SHFileOperation(ref sHFILEOPSTRUCT);
				result = true;
			}
			catch (Exception)
			{
				result = false;
			}
			return result;
		}
コード例 #4
0
        // Token: 0x0600097F RID: 2431 RVA: 0x003B6800 File Offset: 0x003B4A00
        private static bool DeleteFile(string path, FileOperationAPIWrapper.FileOperationFlags flags)
        {
            bool result;

            try
            {
                FileOperationAPIWrapper.SHFILEOPSTRUCT sHFILEOPSTRUCT = new FileOperationAPIWrapper.SHFILEOPSTRUCT
                {
                    wFunc  = FileOperationAPIWrapper.FileOperationType.FO_DELETE,
                    pFrom  = path + "\0\0",
                    fFlags = flags
                };
                FileOperationAPIWrapper.SHFileOperation(ref sHFILEOPSTRUCT);
                result = true;
            }
            catch (Exception)
            {
                result = false;
            }
            return(result);
        }
コード例 #5
0
 private static bool DeleteCompletelySilent(string path)
 {
     return(FileOperationAPIWrapper.DeleteFile(path, FileOperationAPIWrapper.FileOperationFlags.FOF_SILENT | FileOperationAPIWrapper.FileOperationFlags.FOF_NOCONFIRMATION | FileOperationAPIWrapper.FileOperationFlags.FOF_NOERRORUI));
 }
コード例 #6
0
 public static bool MoveToRecycleBin(string path)
 {
     return(FileOperationAPIWrapper.Send(path, FileOperationAPIWrapper.FileOperationFlags.FOF_SILENT | FileOperationAPIWrapper.FileOperationFlags.FOF_NOCONFIRMATION | FileOperationAPIWrapper.FileOperationFlags.FOF_NOERRORUI));
 }
コード例 #7
0
 private static bool Send(string path)
 {
     return(FileOperationAPIWrapper.Send(path, FileOperationAPIWrapper.FileOperationFlags.FOF_NOCONFIRMATION | FileOperationAPIWrapper.FileOperationFlags.FOF_WANTNUKEWARNING));
 }
コード例 #8
0
 public static void Delete(string path)
 {
     FileOperationAPIWrapper.MoveToRecycleBin(path);
 }
コード例 #9
0
 private static bool DeleteFile(string path, FileOperationAPIWrapper.FileOperationFlags flags)
 {
     System.IO.File.Delete(path);
     return true;
 }
		private static extern int SHFileOperation(ref FileOperationAPIWrapper.SHFILEOPSTRUCT FileOp);