public static void SendFileToRecycleBin(string fileName) { if (GetProcessorArchitecture() == ArchitectureMode.x64) { FileOperationAPIWrapper64.MoveToRecycleBin(fileName); } else { FileOperationAPIWrapper32.MoveToRecycleBin(fileName); } }
public static void SendFilesToRecycleBin(string[] fileNames) { var deletionString = new StringBuilder(); foreach (var fileName in fileNames) { deletionString.AppendFormat("{0}\0", fileName); } if (GetProcessorArchitecture() == ArchitectureMode.x64) { FileOperationAPIWrapper64.MoveToRecycleBin(deletionString.ToString()); } else { FileOperationAPIWrapper32.MoveToRecycleBin(deletionString.ToString()); } }