格式
typescript
File.ReadAllBytes(path)所属类: File
描述
读取并返回指定路径的文件中的所有数据到内存流中。
参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| path | string | 指定文件的路径 |
返回值
| 类型 | 描述 |
|---|---|
MemoryStream|undefined | 如果成功,返回内存流数据,否则返回undefined |
代码示例
javascript
function Test(file_path: string) {
try {
let stream = File.ReadAllBytes(file_path);
} catch (error) {
Debug.Error(error);
}
}