谁能帮忙把下面这段代码改成vc2008的unicode下能执行的代码啊。。。
CString CQDlg::GetIPAddress()
{
char buf[MAX_PATH] = {0};
char chTempIp[128];
char chIP[64];
CString strPath;
strPath = GetExePath() + "//netip.ini";
URLDownloadToFile(0,"http://www.ip138.com/ip2city.asp",strPath,0,NULL);
FILE *fp=fopen( strPath, "r" );
if ( fp != NULL )
{
fseek(fp, 0, SEEK_SET);
fread(buf,1,256,fp);
fclose(fp);
char* iIndex = strstr(buf,"[");
if (iIndex)
{
sprintf( chTempIp,"%s",iIndex);
int nBuflen = strlen(chTempIp);
for(int i =0; i<nBuflen; i++)
{
chIP[i] = chTempIp[i+1];
if(chTempIp[i] == ']')
{
chIP[i-1] = '/0';
DeleteFile(strPath);
continue;
}
}
}
}
CString strTemp="";
if(chIP != "")
{
strTemp.Format("%s",chIP);
}
return strTemp;
}