当前位置:网站首页>使用win32 api读文件
使用win32 api读文件
2022-07-22 00:47:00 【草丛中的蝈蝈】
BOOL bResult;
HANDLE hFile;
//
hFile = ::CreateFile(TEXT("e:/test.txt"),
GENERIC_READ,
0,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
//
if (hFile == INVALID_HANDLE_VALUE)
{
return;
}
//
char readBuffer[1024];
ZeroMemory(readBuffer, sizeof(readBuffer));
DWORD dwBytesRead = 0;
DWORD dwError = 0;
bResult = ::ReadFile(hFile, readBuffer, 4, &dwBytesRead, NULL);
if (!bResult)
{
return;
}
边栏推荐
猜你喜欢
Cache and redirection in HTTP practice
22张图带你深入剖析前缀、中缀、后缀表达式以及表达式求值
基於STM32無人超市消費系統設計
AI robot era in the eyes of Ubisoft Technology
parker液压油泵PV140R1K1T1NMM1
3. ZABBIX installation
Yolov7 experiment test II: remote sensing image detection application (yolov7 tiny silu.yaml)
狂神redis笔记08
MFC 使用注册窗口信息的方式获取CFindReplaceDialog控件消息
文件操作下(C语言)
随机推荐
Salted fish self rescue guide -- typescript about interfaces
IO扩展控件(System.IO.Abstractions)
[development of large e-commerce projects] thread pool - completable future -48
解决v-for中el-popover显示等问题
时间复杂度与复杂度
Rexroth proportional valve 4wrpeh6c3b04l-3x/m/24f1-885
The 22 pictures show you in-depth analysis of prefix, infix, suffix expressions and expression evaluation
51单片机外设篇:LED点阵
dom——事件链(捕获目标和捕获)
Summary of common APIs of OpenCV (quick query)
BOM operation - jog animation
官版树莓派Pi Pico和YD-RP2040版本对比
With an annual salary of 30W, the growth path of software testers, at which stage are you?
MySQL index classification and its application examples
[machine learning] is it necessary to balance samples in machine learning
香港云服务器和物理服务器哪个更容易宕机?
Go language go command line tool
年薪30W,软件测试人的成长之路,你在哪个阶段?
Interlaced color change of table
AI robot era in the eyes of Ubisoft Technology