分享

夸版本下载

 水中麒麟 2013-09-11
在 主对话框之前 弹出一个对话框,然后选区

点击了这个按钮后 就退出这个窗体执行其他的 !


-----------------------------------

CString GetFileEndLine(CString &strFile,int Mode)
{
CStdioFile file;

bool flag=file.Open(strFile,Mode);
if(!flag)
{
return NULL ;

}

CString strLine;
CString strEndLine;

while(file.ReadString(strLine))
{
strEndLine=strLine;


}
file.Close();
return strEndLine;


}
void CFileTestDlg::OnBnClickedOk()
{
// TODO: 在此添加控件通知处理程序代码

// NULL;
CString strFile;
strFile.Format("%s","./versionnew.ini");
CString strEndLine;
strEndLine=GetFileEndLine(strFile,CFile::modeRead);

CString strData;
strData.Format("%s",strEndLine.Right(1));

int a=atoi(strData);
if(4==a)
{
MessageBox(strData);
}

//  打开本地的版本号,决定要下载几个补丁

strFile.Format("%s","./version.ini");
strEndLine=GetFileEndLine(strFile,CFile::modeRead);
strData.Format("%s",strEndLine.Right(1));

int b=atoi(strData);
if(0==b)
{
MessageBox(strData);
}
if((a-b)==4)
{
MessageBox("下载四个版本");
// 这个 4 进去
CreateThead();

}
//OnOK();
}
  threadFunc()
  {
int data =4; 传进来的
for(int i=0;i<data;i++)
{
下载 

下载成功 --  合包 -- 写入本地文件(就前进了一个版本)

}

  }

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多