| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 3 |
| 经验 | |
| 最后登录 | 2019-10-13 |
| 在线时间 | 953 小时 |
- 梦石
- 0
- 星屑
- 310
- 在线时间
- 953 小时
- 注册时间
- 2007-4-25
- 回帖
- 798
|
发表于 2010-12-20 00:49:01
|
显示全部楼层
- class String
- @@MultiByteToWideChar = Win32API.new("kernel32", "MultiByteToWideChar", ['I', 'L', 'P', 'I', 'P', 'I'], 'I')
- def to_unicode
- len = @@MultiByteToWideChar.call(65001, 0, self, -1, 0, 0) << 1
- buf =" " * len
- @@MultiByteToWideChar.call(65001, 0, self, -1, buf, len)
- return buf
- end
- end
- sh_file_operation = Win32API.new('shell32', 'SHFileOperationW', 'P', 'i')
- src = "./Data/*\0"
- dest = "./NewData\0"
- op_struct = [0, 2, src.to_unicode, dest.to_unicode, 4 | 0x10 | 0x0200, 0, 0, 0].pack('iIppSiii')
- sh_file_operation.call(op_struct)
复制代码 这里使用的是相对路径,Data 是源目录,NewData 是需要拷贝到的目的目录。 |
评分
-
查看全部评分
|