读取文件字符串 - ReadFileString
函数简介
- 按指定编码读取文件内容,并以字符串形式返回。
接口名称
ReadFileString
DLL调用
long ReadFileString(long instance, string filePath, int encoding)
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| filePath | 字符串 | 要读取的文件完整路径。 |
| encoding | 整数型 | 字符编码方式:-1 自动检测;0 GBK;1 Unicode;2 UTF-8;3 UTF-8(BOM自动去除)。 |
示例
// 示例代码待补充
返回值
返回文件内容字符串的指针,失败返回0。
注意事项
- 返回的字符串指针需调用 FreeStringPtr 接口释放内存。
