Location:
Search - READFILE
Search list
Description: 打开一个TXT文件并显示在EDIT控件中
步骤:
1.新建一个基于对话框的工程,名称为ReadFile
2.在界面上添加一个按钮(IDC_BUTTON1)和一个文本编辑(IDC_EDIT1)
IDC_EDIT1的属性:多行、可下拉滚动条.
3.编辑按钮触发事件(void CReadFileDlg::OnButton1())
void CReadFileDlg::OnButton1()
{
// TODO: Add your control notification handler code here
CString sFileFilter=\"*.hex|*.hex\"
CString sFileName
CFileDialog fDlg(true,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,sFileFilter,NULL)
fDlg.DoModal()
sFileName=fDlg.GetFileName()
if(sFileName!=\"\")
{
CFile file(sFileName,CFile::modeRead)
int nFileLength=file.GetLength()
char *buffer
HGLOBAL hgl=::GlobalAlloc(GMEM_MOVEABLE,nFileLength+1)
buffer=(char *)::GlobalLock(hgl)
file.Read(buffer,nFileLength)
SetDlgItemText(IDC_EDIT1,buffer)
::GlobalUnlock(hgl)
::GlobalFree(hgl)
}
UpdateData(false)
}
Platform: |
Size: 26089 |
Author: 这程子 |
Hits:
Description: 读文件,.ini操作-read documents. Ini operation
Platform: |
Size: 18432 |
Author: 王子 |
Hits:
Description: 从串口读取数据,有两种方法,1、每接收一个EV_RXCHAR,就用ReadFile读一次,这样我觉得太恐怖了。2、接收到一个EV_RXCHAR后,等一定数据量的CPU周期(GetTickCount),再一次性读取缓冲区里的数据。这样做,一般情况下不会有问题,但是,如果数据很多,过了“一定数据量的CPU周期”,还没收完数据怎么办?就会少读数据了。 我用三个线程序来完成串口数据的接收,其实就是第一种方法的变种: 一个侦听EV_RXCHAR,一个对EV_RXCHAR进行分析,其实就是超时判断。如果接收到一个消息后,一段时间没收到下一个EV_RXCHAR,就认为是一个数据包的结束。这个线程就会通知数据接收线程,进行数据接收。一般同一包数据,两个字符之间的时间间隔,应该很小了吧,而两个数据包之间的间隔,应该不会太小吧!(这个地方我不清楚,猜的:( :) )最后一个线程,是接收数据的。-read data from the serial port, there are two methods, one, each receiving a EV_RXCHAR, on the ReadFile read, I think this vote. 2, received a EV_RXCHAR after a certain volume of data, such as CPU cycles (GetTickCount), and the one-time reader, the data buffer. To do so, under normal circumstances there is no problem, but if many of the data, and after a "certain amount of data the CPU cycles," also confiscated End Data how do? Few will read the data. I used three lines to complete serial data reception, the first method is a variant : an interception EV_RXCHAR, one pair of EV_RXCHAR analysis is, in fact, overtime judgment. If a receiver to the news, some time had not received a EV_RXCHAR, it is a data packet to an end. This thread will receive notification of data threads for da
Platform: |
Size: 46080 |
Author: 刘云鹏 |
Hits:
Description: USB驱动协议的简化版。如果你想打开一个USB管道,你首先要知道这种USB设备的GUID和管理道名称,获取句柄以后就可以使用ReadFile/WriteFile进行读写了!-USB drives a simplified version of the agreement. If you want to open a channel USB, you must first know the GUID USB devices Road names and management, acquisition handle can use it after ReadFile/WriteFile write!
Platform: |
Size: 2048 |
Author: 郑卓超 |
Hits:
Description: VC读写txt文件的程序,数据由空格,逗号或回车分隔开,还包括读取图位文件和二进制文件!-VC literacy txt documents, data from space, or comma separated from the transport, including map-reading documents and binary files!
Platform: |
Size: 3639296 |
Author: |
Hits:
Description: 本程序演示const char *与char * const的区别。C语言对文件读写的支持,FILE指针;文本文件和二进制文件的区别。用文本方式读写文件和以二进制方式读写文件的注意事项。C++对文件读写的支持,ofstream和ifstream的用法。Win32 SDK对文件读写的支持,CreateFile函数、WriteFile函数、ReadFile函数的使用;MFC对文件读写的支持,CFile类和CFileDialog的使用,文件过滤器的设置。win.ini文件和注册表的读写方式及相关知识点。-demonstration of the procedures const char* const char* distinction. C language of the document to read and write support, FILE pointer; Text and binary files distinction. Text mode is used to read and write files in binary mode and document literacy matters to the attention. C of the document to read and write support, and ofstream ifstream usage. Win32 SDK documentation to support literacy, CreateFile function, WriteFile function, ReadFile function; MFC right document literacy support CFile CFileDialog class and the use of file filters set. Extracts documents and the registry of literacy and associated knowledge point.
Platform: |
Size: 38912 |
Author: qiyunping |
Hits:
Description: 命名管道充分利用了Windows NT和Windows 2000内建的安全机制。
将命名管道作为一种网络编程方案时,它实际上建立了一个客户机/服务器通信体系,并在其中可靠地传输数据。
命名管道是围绕Windows文件系统设计的一种机制,采用“命名管道文件系统(Named Pipe File System,NPFS)”接口,因此,客户机和服务器可利用标准的Win32文件系统函数(例如:ReadFile和WriteFile)来进行数据的收发。
-named pipe full advantage of the Windows NT and Windows 2000 built-in security system system. To be named as a pipeline network programming package, which is actually the establishment of a client/server communication system, and in which reliable data transmission. A named pipe is on the Windows file system design of a mechanism, "Named Pipe File System (Named Pipe File System, NPFS) "interface, therefore, client and server can use standard Win32 file system functions (such as : ReadFile and WriteFile) data to the transceiver.
Platform: |
Size: 245760 |
Author: 李思川 |
Hits:
Description: VC++中使用内存映射文件处理大文件,文件操作是应用程序最为基本的功能之一,Win32 API 和MFC 均提供有支持
文件处理的函数和类,常用的有Win32 API 的CreateFile()、WriteFile()、
ReadFile()和MFC 提供的CFile 类等-VC use memory-mapped file handling large files, file manipulation application is the most basic function, MFC and Win32 API is available to support the document processing functions and classes, used the Win32 API CreateFile (), WriteFile (), ReadFile () and the MFC CFile type
Platform: |
Size: 103424 |
Author: victor |
Hits:
Description: 如果你想打开一个USB管道,你首先要知道这种USB设备的GUID和管理道名称,
获取句柄以后就可以使用ReadFile/WriteFile进行读写了!-If you want to open a USB pipeline You must first know the GUID of USB devices and management Road name, Access handles can use it after ReadFile/WriteFile for literacy!
Platform: |
Size: 2048 |
Author: 副类 |
Hits:
Description: 用c语言实现读取配置文件. 书写比较规范,比较好!-c language used to read configuration files. Writing relatively standardized, relatively good!
Platform: |
Size: 1024 |
Author: bolin.gong |
Hits:
Description: const char *与char * const的区别。C语言对文件读写的支持,FILE指针;文本文件和二进制文件的区别。用文本方式读写文件和以二进制方式读写文件的注意事项。C++对文件读写的支持,ofstream和ifstream的用法。Win32 SDK对文件读写的支持,CreateFile函数、WriteFile函数、ReadFile函数的使用;MFC对文件读写的支持,CFile类和CFileDialog的使用,文件过滤器的设置。win.ini文件和注册表的读写方式及相关知识点。-const char* and char* const distinction. C language of the document to read and write support, FILE pointer text file and binary file distinction. Used to read and write text files and read and write files in binary mode Notes. C++ Of documents to read and write support, ofstream and ifstream usage. Win32 SDK to read and write support for the document, CreateFile function, WriteFile function, ReadFile function to use MFC support reading and writing of the document, CFile Class CFileDialog and the use of paper filter settings. win.ini file and registry read and write methods and related knowledge points.
Platform: |
Size: 53248 |
Author: 快乐 |
Hits:
Description: 实现串行通讯的相关API函数
API函数不仅提供了打开和读写通讯端口的操作方法,还提供了名目繁多的函数以支持对串行通讯的各种操作。
函数名 作用
CreateFile 打开串口
GetCommState 检测串口设置
SetCommState 设置串口
BuilderCommDCB 用字符串中的值来填充设备控制块
GetCommTimeouts 检测通信超时设置
SetCommTimeouts 设置通信超时参数
SetCommMask 设定被监控事件
WaitCommEvent 等待被监控事件发生
WaitForMultipleObjects 等待多个被监测对象的结果
WriteFile 发送数据
ReadFile 接收数据
GetOverlappedResult 返回最后重叠(异步)操作结果
PurgeComm 清空串口缓冲区,退出所有相关操作
ClearCommError 更新串口状态结构体,并清除所有串口硬件错误
CloseHandle 关闭串行口
Platform: |
Size: 5120 |
Author: liupengty |
Hits:
Description: 用三种方式进行文件缓存的操作,并通过比较平均时间来了解文件缓存的工作原理,涉及的主要API函数有CreateFile,ReadFile和WriteFile,GetOverlappedResult函数-Three way file cache operation, and by comparing the average time to understand the file cache
Platform: |
Size: 1989632 |
Author: 郭浩 |
Hits:
Description: 用三种方式进行文件缓存的操作,并通过比较平均时间来了解文件缓存的工作原理,涉及的主要API函数有CreateFile,ReadFile和WriteFile,GetOverlappedResult函数-Three way file cache operation, and by comparing the average time to understand the file cache
Platform: |
Size: 2063360 |
Author: 郭浩 |
Hits:
Description: 简单的把读的文件中的字母由小写改为大写
只需在程序写的相应目录建相应文件即可-Simple to read documents in lowercase letters changed to uppercase by the program just to write the corresponding directory to build the corresponding document can be
Platform: |
Size: 58368 |
Author: 陈亮 |
Hits:
Description: 读写文件,用java实现,带有详细的注释。-Reading and writing documents, using java realize, with detailed notes.
Platform: |
Size: 12288 |
Author: 卉 |
Hits:
Description: 打开一个TXT文件并显示在EDIT控件中
步骤:
1.新建一个基于对话框的工程,名称为ReadFile
2.在界面上添加一个按钮(IDC_BUTTON1)和一个文本编辑(IDC_EDIT1)
IDC_EDIT1的属性:多行、可下拉滚动条.
3.编辑按钮触发事件(void CReadFileDlg::OnButton1())
void CReadFileDlg::OnButton1()
{
// TODO: Add your control notification handler code here
CString sFileFilter="*.hex|*.hex"
CString sFileName
CFileDialog fDlg(true,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,sFileFilter,NULL)
fDlg.DoModal()
sFileName=fDlg.GetFileName()
if(sFileName!="")
{
CFile file(sFileName,CFile::modeRead)
int nFileLength=file.GetLength()
char *buffer
HGLOBAL hgl=::GlobalAlloc(GMEM_MOVEABLE,nFileLength+1)
buffer=(char *)::GlobalLock(hgl)
file.Read(buffer,nFileLength)
SetDlgItemText(IDC_EDIT1,buffer)
::GlobalUnlock(hgl)
::GlobalFree(hgl)
}
UpdateData(false)
}
-Open a TXT file and displayed in the EDIT control steps: 1. Create a new dialog-based project, known as the ReadFile2. In the interface to add a button (IDC_BUTTON1) and a text editor (IDC_EDIT1) IDC_EDIT1 properties: multi-line, can be drop-down scroll bar .3. Edit button trigger events (void CReadFileDlg:: OnButton1 ()) void CReadFileDlg:: OnButton1 () (//TODO: Add your control notification handler code here CString sFileFilter =*. hex |*. hex CString sFileName CFileDialog fDlg (true, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, sFileFilter, NULL) fDlg.DoModal () sFileName = fDlg.GetFileName () if (sFileName! =) (CFile file (sFileName, CFile:: modeRead) int nFileLength = file.GetLength () char* buffer HGLOBAL hgl =:: GlobalAlloc (GMEM_MOVEABLE, nFileLength+ 1) buffer = (char*):: GlobalLock (hgl) file.Read (buffer, nFileLength) SetDlgItemText (IDC_EDIT1, buffer):: GlobalUnlock (hgl):: GlobalFree (hgl)) UpdateData (false))
Platform: |
Size: 1888256 |
Author: 这程子 |
Hits:
Description: 孙鑫老师VC视频第十二课代码:const char *与char * const的区别。C语言对文件读写的支持,FILE指针;文本文件和二进制文件的区别。用文本方式读写文件和以二进制方式读写文件的注意事项。C++对文件读写的支持,ofstream和ifstream的用法。Win32 SDK对文件读写的支持,CreateFile函数、WriteFile函数、ReadFile函数的使用;MFC对文件读写的支持,CFile类和CFileDialog的使用,文件过滤器的设置。win.ini文件和注册表的读写方式及相关知识点。-SUN Xin video twelfth class teacher VC code: const char* and char* const distinction. C language of the document to read and write support, FILE pointer text file and binary file distinction. Used to read and write text files and read and write files in binary mode Notes. C++ Of documents to read and write support, ofstream and ifstream usage. Win32 SDK to read and write support for the document, CreateFile function, WriteFile function, ReadFile function to use MFC support reading and writing of the document, CFile Class CFileDialog and the use of paper filter settings. win.ini file and registry read and write methods and related knowledge points.
Platform: |
Size: 38912 |
Author: shanyingying |
Hits:
Description: 文本文件和二进制文件的区别。用文本方式读写文件和以二进制方式读写文件的注意事项。C++对文件读写的支持,ofstream和ifstream的用法。Win32 SDK对文件读写的支持,CreateFile函数、WriteFile函数、ReadFile函数的使用;MFC对文件读写的支持,CFile类和CFileDialog的使用-Text file and binary file distinction. Used to read and write text files and read and write files in binary mode Notes. C++ Of documents to read and write support, ofstream and ifstream usage. Win32 SDK to read and write support for the document, CreateFile function, WriteFile function, ReadFile function to use MFC support reading and writing of the document, CFile Class CFileDialog and the use of
Platform: |
Size: 286720 |
Author: 周游 |
Hits:
Description: 这是一个用VC++编写的实现读写大块资料(
二进制)文件的程序-This is a used VC++ Realize prepared to read and write large pieces of data (binary) files
Platform: |
Size: 237568 |
Author: 李轶 |
Hits: