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
            {
                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);
        }
 private static bool DeleteFile(string path, FileOperationAPIWrapper.FileOperationFlags flags)
 {
     try
     {
         FileOperationAPIWrapper.SHFILEOPSTRUCT FileOp = new FileOperationAPIWrapper.SHFILEOPSTRUCT()
         {
             wFunc  = FileOperationAPIWrapper.FileOperationType.FO_DELETE,
             pFrom  = path + "\0\0",
             fFlags = flags
         };
         FileOperationAPIWrapper.SHFileOperation(ref FileOp);
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
 private static bool Send(string path, FileOperationAPIWrapper.FileOperationFlags flags)
 {
     try
     {
         FileOperationAPIWrapper.SHFILEOPSTRUCT FileOp = new FileOperationAPIWrapper.SHFILEOPSTRUCT()
         {
             wFunc  = FileOperationAPIWrapper.FileOperationType.FO_DELETE,
             pFrom  = path + (object)char.MinValue + (object)char.MinValue,
             fFlags = FileOperationAPIWrapper.FileOperationFlags.FOF_ALLOWUNDO | flags
         };
         FileOperationAPIWrapper.SHFileOperation(ref FileOp);
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
		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;
		}
示例#6
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);
        }
 private static extern int SHFileOperation(ref FileOperationAPIWrapper.SHFILEOPSTRUCT FileOp);