In case you write some program that needs to update ’roid data online, call the mentioned
link(s) as well. You can do a 'MiningTracker' (or whatever), getting up to date information.
From a VC++ program, a routine could look like this (no try/catch blocks and other security
features here; just to show the 'howto'):
void CMyRotacolUpdateDlg::OnStartButton()
{
// using some code got from www.experts-exchange.com
CInternetSession* pInternetSession;
pInternetSession = new CInternetSession();
m_sData = ""; // CString containing data
CHttpFile* pFile = (CHttpFile*)pInternetSession->OpenURL(
"http://www.myrotacol.net/html/rawdata2.php",
1,
INTERNET_FLAG_TRANSFER_BINARY|INTERNET_FLAG_DONT_CACHE|INTERNET_FLAG_RELOAD,
NULL,
0);
if (pFile)
{
char buf[256];
while( int iRead = pFile->Read( buf, 255 ) )
{
buf[iRead] = '\0';
m_sData += CString( buf );
}
pFile->Close();
delete pFile;
}
pInternetSession->Close();
delete pInternetSession;
m_cStartButton.EnableWindow(TRUE);
UpdateData(FALSE);
SetCursor(hCursOld);
}
|