VB中如何能加载含有类似这中字符的图像,如果AA❤.jpg.

PhotosShop 2011-06-23 10:27:44
有一些特殊符号的的文件,用VB的loadpicture或者API都无法打开啊。改怎么处理比较好呢?
...全文
52 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2011-06-24
  • 打赏
  • 举报
回复
使用API CopyFile的Unicode版本CopyFileW拷贝源文件一份到一个临时文件,然后加载这个临时文件。
CopyFile
The CopyFile function copies an existing file to a new file.

BOOL CopyFile(
LPCTSTR lpExistingFileName,
// pointer to name of an existing file
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);

Parameters
lpExistingFileName
Pointer to a null-terminated string that specifies the name of an existing file.
lpNewFileName
Pointer to a null-terminated string that specifies the name of the new file.
bFailIfExists
Specifies how this operation is to proceed if a file of the same name as that specified by lpNewFileName already exists. If this parameter is TRUE and the new file already exists, the function fails. If this parameter is FALSE and the new file already exists, the function overwrites the existing file and succeeds.
Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks
Security attributes for the existing file are not copied to the new file.

File attributes for the existing file are copied to the new file. For example, if an existing file has the FILE_ATTRIBUTE_READONLY file attribute, a copy created through a call to CopyFile will also have the FILE_ATTRIBUTE_READONLY file attribute.

Windows CE: If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError.

QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also
File I/O Overview, File Functions, CreateFile, MoveFile

咸清 2011-06-24
  • 打赏
  • 举报
回复
改名⋯⋯
这属于系统命名规则不统一造就的
既然允许人家这么起名,就应该允许人家在其它地方调用。属于MS的系统Dug

809

社区成员

发帖
与我相关
我的任务
社区描述
VB 多媒体
社区管理员
  • 多媒体
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧