博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
API Copy Big FIles
阅读量:4703 次
发布时间:2019-06-10

本文共 1527 字,大约阅读时间需要 5 分钟。

public class ApiCopyFile        {            private const int FO_COPY = 0x0002;            private const int FOF_ALLOWUNDO = 0x00044;            //显示进度条  0x00044 // 不显示一个进度对话框 0x0100 显示进度对话框单不显示进度条  0x0002显示进度条和对话框              private const int FOF_SILENT = 0x0002;//0x0100;              //              [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 0)]            public struct SHFILEOPSTRUCT            {                public IntPtr hwnd;                [MarshalAs(UnmanagedType.U4)]                public int wFunc;                public string pFrom;                public string pTo;                public short fFlags;                [MarshalAs(UnmanagedType.Bool)]                public bool fAnyOperationsAborted;                public IntPtr hNameMappings;                public string lpszProgressTitle;            }            [DllImport("shell32.dll", CharSet = CharSet.Auto)]            static extern int SHFileOperation(ref SHFILEOPSTRUCT FileOp);            public static bool DoCopy(string strSource, string strTarget)            {                SHFILEOPSTRUCT fileop = new SHFILEOPSTRUCT();                fileop.wFunc = FO_COPY;                fileop.pFrom = strSource;                fileop.lpszProgressTitle = "复制大文件";                fileop.pTo = strTarget;                //fileop.fFlags = FOF_ALLOWUNDO;                  fileop.fFlags = FOF_SILENT;                return SHFileOperation(ref  fileop) == 0;            }        }

 

转载于:https://www.cnblogs.com/EthanSun/p/3204682.html

你可能感兴趣的文章
Git Stash用法
查看>>
sql server 2008学习8 sql server存储和索引结构
查看>>
Jquery radio选中
查看>>
memcached 细究(三)
查看>>
RSA System.Security.Cryptography.CryptographicException
查看>>
webservice整合spring cxf
查看>>
[解题报告] 100 - The 3n + 1 problem
查看>>
Entity Framework 学习高级篇1—改善EF代码的方法(上)
查看>>
Mybatis逆向工程配置文件详细介绍(转)
查看>>
String类的深入学习与理解
查看>>
不把DB放进容器的理由
查看>>
OnePage收集
查看>>
Java parseInt()方法
查看>>
yahoo的30条优化规则
查看>>
[CCF2015.09]题解
查看>>
[NYIST15]括号匹配(二)(区间dp)
查看>>
json_value.cpp : fatal error C1083: 无法打开编译器生成的文件:No such file or directory
查看>>
洛谷 P1101 单词方阵
查看>>
Swift DispatchQueue
查看>>
C#和JAVA 访问修饰符
查看>>