110,534
社区成员
发帖
与我相关
我的任务
分享
public static bool Copy(string from, string to)
{
SHFILEOPSTRUCT shf = new SHFILEOPSTRUCT();
shf.wFunc = FO_COPY;
shf.fFlags = FOF_ALLOWUNDO;
shf.pFrom = from;
shf.pTo = to;
return SHFileOperation(ref shf) == 0;
}
调用上面那个方法:
FileEx.Copy(pcPath, mp3Path);
[DllImport("setupapi.dll", EntryPoint = "CM_Request_Device_Eject")]
internal static extern int CM_Request_Device_Eject_NoUi(int dnDevInst, IntPtr pVetoType, StringBuilder pszVetoName, int ulNameLength, int ulFlags);