void CUpdateDlg::OnButtonDoupdate()
{
// 讀取升級文件
CFileStatus rStatus;
CString szIniData;
CString inFile;
CString tmp;
inFile=m_szPath+
CFile UpdateFile;
UpdateFile
UpdateFile
UpdateFile
UpdateFile
CStringArray arType;
CStringArray arVersion;
for(int i=
AfxExtractSubString(tmp
tmp
tmp
arType
}
for(int j=
AfxExtractSubString(tmp
tmp
tmp
arVersion
}
GetDlgItem(IDC_BUTTON_DOUPDATE)
CProgressCtrl* pBar = (CProgressCtrl*)GetDlgItem(IDC_PROGRESS_UPDATE);
pBar
m_szEditMessage =
UpdateData(FALSE);
CInternetSession mySession(NULL
CHttpFile* myHttpFile=NULL;
BOOL bIsNewer = FALSE;
CString myData;
CString myUrl;
CString m_SiteRec;
myUrl = ServerUrl+
myHttpFile=(CHttpFile*)mySession
while(myHttpFile
myHttpFile
mySession
if(m_SiteRec==
pBar
m_szEditMessage =
UpdateData(FALSE);
for(int k=
CInternetSession mySession(NULL
CHttpFile* myHttpFile=NULL;
m_SiteRec
myUrl = ServerUrl+
myHttpFile=(CHttpFile*)mySession
while(myHttpFile
if(m_SiteRec !=
CString inFile;
inFile=m_szPath+
CFile NetFile;
NetFile
NetFile
NetFile
bIsNewer = TRUE;
}
pBar
m_szEditMessage =
UpdateData(FALSE);
myHttpFile
mySession
}
if(bIsNewer){
::MessageBox(NULL
}else{
::MessageBox(NULL
}
}else{
::MessageBox(NULL
pBar
}
// 下面是完成了
GetDlgItem(IDCANCEL)
GetDlgItem(IDOK)
GetDlgItem(IDOK)
}
From:http://tw.wingwit.com/Article/program/Java/hx/201311/25747.html