mobie6.1下读TXT文本问题
读文件代码 CString str,szline;
CStdioFile m_file;
while(m_file.ReadString(szline))
{
str=_T("");
str+=szline;
m_list1.AddString(str);
szline.Empty();
}
UNICODE文本
RESET,4
RSA,6000000000,0000,9000,1,0
RSA2,6100000000,0000,9000,1,0
S3_Send_Data_81,19000000ff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfe,0000,9000,1,1
Receive_Card_Data255_82,16000000ff,0000,000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfe9000,1,0
N_packege_Start,2900000000,0000,9000,1,1
S3_Send_Data_81读完退出, 后面的的不再读.期待高手指点.谢谢!!
--------------------编程问答-------------------- mark --------------------编程问答-------------------- 第一次写VC的程序,很多地方搞不清楚.麻烦说明白点.我菜 --------------------编程问答-------------------- 没看懂你的问题在什么地方。 --------------------编程问答-------------------- 肯定是程序的逻辑问题。
楼主单步跟踪代码调试一下。 --------------------编程问答-------------------- S3_Send_Data_81,19000000ff000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfe,0000,9000,1,1
读完退出,如果在后面加两行短指令如
RSA,6000000000,0000,9000,1,0
RSA2,6100000000,0000,9000,1,0
则可以正常读.
我是逐行读文本内容到szline(CString)中,是不是CString对数据长度大小有限制?超过多少字节就读不了.查了MSDN好象没具体说.
--------------------编程问答-------------------- 通过Memory窗口查看一下szLine地址是什么内容,看看是不是读得完全 , 在Debug下查看实际字符串变量值时遇到'\0'后面的内容是看不完, 这时可以通过Memory窗口来查看 --------------------编程问答-------------------- 友情up
补充:移动开发 , Windows Phone