读取文本文件并在编辑框中显示数据 [英] Read a Text File and Display the data in an Edit Box

查看:117
本文介绍了读取文本文件并在编辑框中显示数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是Visual C ++,MFC的新手. 我想做的是,读取文本文件数据,并在不使用打开对话框的情况下在只读多行编辑框中显示该文本文件数据.文件的长度是可变的.我能够在编辑框中显示文本文件数据,但我使用CTime类获取事件发生的时间并将其写入文本文件中,但在读取时只能读取时间和时间前面的数据丢失.有人可以帮我吗?

例如:-2012年8月20日-17.30.45初始化LED测试....

因此,当我开始阅读并在编辑框中显示该内容时,只有
20/08/2012-17.30.45
显示,其余数据丢失.

请帮我解决这个问题?

在此先感谢....

Hello everyone, I am new to Visual C++, MFC.
What i m trying to do is, Read the text file data and display the same in a Read Only, Multiline Edit Box without using open Dialog box. The length of file is variable.I am able to display the text file data in an edit box but i m using CTime class to get the time when the event takes place and writing the same in Text file but while reading m only able to read the time and the data in front of time is missing. can anyone pls help me with the same?

For Example:- 20/08/2012 - 17.30.45 Initializing LED test....

so when i start reading and displaying the same in an edit box, only
20/08/2012-17.30.45
is displayed and rest data is lost.

kindly help me how to solve this problem?

Thanks in advance....

推荐答案

请参阅从此处读取文本文件的过程..
http://support.microsoft.com/kb/307398 [
See the process of reading a text file from here..
http://support.microsoft.com/kb/307398[^]
After that while displaying data you need some string operation over that..It''s up to you man,you can''t expect whole of your code from here.So try it yourself,then tell us what problem you are facing..


这篇关于读取文本文件并在编辑框中显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆