文本数据如下:
cl^陈玲^MEMBA^ACDE
cd^陈单^A^ACDE
WD^王董^A^ACDE
YHS^杨海生^A^ACDE
SYZ^史一枝^A^ACDE
wyt^韦毅^A^ACDE
fj^冯佳^A^ACDE
YJ^杨佳^A^ACDE其中 第1部分是编码号 第2部分是人员名 第3部分是一个加密后的密码 第4部分是权限下面是我在VC6.0下通过的读这个文本中的代码 可是移植到PPC上 就卡住了
代码如下:
void CLoginFaceDlg::OnBnClickedButton1()
{
CString pszFileName =_T("\\My Documents\\czy.bst");
CStdioFile file;
if(!file.Open(pszFileName,CFile::modeRead ))
{
AfxMessageBox(_T("不能打开文件!"));
exit(1) ;
} else
{ CString strTemp;
CString temp;
CStringArray nameArray;
CStringArray passwordArray;
CComboBox *combo=(CComboBox *)GetDlgItem(IDC_COMBO1); file.ReadString(strTemp);
while(!strTemp.IsEmpty())
{
while(strTemp.Left(1)!="^")
strTemp=strTemp.Right(strTemp.GetLength()-1); strTemp=strTemp.Right(strTemp.GetLength()-1); while(strTemp.Left(1)!="^")
{
temp+=strTemp.Left(2);
strTemp=strTemp.Right(strTemp.GetLength()-2);
}
combo->AddString(temp);
nameArray.Add(temp);
temp="";
strTemp=strTemp.Right(strTemp.GetLength()-1); while(strTemp.Mid(1,1)!="^")
{
temp+=strTemp.Left(1);
strTemp=strTemp.Right(strTemp.GetLength()-1);
} while(strTemp.Mid(1,1)!="^")
{
temp+=strTemp.Left(1);
strTemp=strTemp.Right(strTemp.GetLength()-1);
} passwordArray.Add(temp);
temp="";
file.ReadString(strTemp); }
} file.Close(); }
请好心人帮帮忙 真的很急 !
cl^陈玲^MEMBA^ACDE
cd^陈单^A^ACDE
WD^王董^A^ACDE
YHS^杨海生^A^ACDE
SYZ^史一枝^A^ACDE
wyt^韦毅^A^ACDE
fj^冯佳^A^ACDE
YJ^杨佳^A^ACDE其中 第1部分是编码号 第2部分是人员名 第3部分是一个加密后的密码 第4部分是权限下面是我在VC6.0下通过的读这个文本中的代码 可是移植到PPC上 就卡住了
代码如下:
void CLoginFaceDlg::OnBnClickedButton1()
{
CString pszFileName =_T("\\My Documents\\czy.bst");
CStdioFile file;
if(!file.Open(pszFileName,CFile::modeRead ))
{
AfxMessageBox(_T("不能打开文件!"));
exit(1) ;
} else
{ CString strTemp;
CString temp;
CStringArray nameArray;
CStringArray passwordArray;
CComboBox *combo=(CComboBox *)GetDlgItem(IDC_COMBO1); file.ReadString(strTemp);
while(!strTemp.IsEmpty())
{
while(strTemp.Left(1)!="^")
strTemp=strTemp.Right(strTemp.GetLength()-1); strTemp=strTemp.Right(strTemp.GetLength()-1); while(strTemp.Left(1)!="^")
{
temp+=strTemp.Left(2);
strTemp=strTemp.Right(strTemp.GetLength()-2);
}
combo->AddString(temp);
nameArray.Add(temp);
temp="";
strTemp=strTemp.Right(strTemp.GetLength()-1); while(strTemp.Mid(1,1)!="^")
{
temp+=strTemp.Left(1);
strTemp=strTemp.Right(strTemp.GetLength()-1);
} while(strTemp.Mid(1,1)!="^")
{
temp+=strTemp.Left(1);
strTemp=strTemp.Right(strTemp.GetLength()-1);
} passwordArray.Add(temp);
temp="";
file.ReadString(strTemp); }
} file.Close(); }
请好心人帮帮忙 真的很急 !
解决方案 »
- 关于兼容位图的问题...
- 字符串拆分后连续socket问题(老是发最后一个拆分的字符)
- 求助:串口收不到数据
- OpenSCManager函数返回错误的问题?
- Recordset添加问题
- 求《windows网络编程》下载地址!
- SDI非doc/view的工程如何改变视图(view)
- 如何在GUI程序中,实现某个控制台窗口输出计算数据?
- vc编dao的数据库应用,在win2000,me下可通过,但win98 不行,help!!!
- STL问题,为什么显示不出map中存入的值?总说内存为只读。(原码在里面),help me!
- 50分!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!怎么做到修改不了一个注册表表项?
- 关于抓屏的一个很技术的问题
上面的代码在VS2005本机环境能运行 可是在PPC上不行