void  get_WanIp()
{ char Buf_File_Read[MAX_PATH] = {};
char IP_Temp[];
char IP_Host[];
int Result_URLDownloadToFile = ;
char szFilePath[MAX_PATH] = {};
GetTempPathA(MAX_PATH,szFilePath);
strcat(szFilePath,"IPinTheWorld.ini"); Result_URLDownloadToFile = URLDownloadToFileA(,"http://ip.dnsexit.com/index.php",szFilePath,,NULL);
if(Result_URLDownloadToFile != )//若URLDownloadToFile()成功,返回0
{
MessageBox(NULL, "网络故障,无法接入Internet,请联系网络管理员","提示",MB_ICONASTERISK);
return ;
} FILE *fp_Download_URL_File=NULL;
if ((fp_Download_URL_File=fopen( szFilePath,"r")) == NULL)
{
MessageBox(NULL, "系统故障,无法打开IP文件,请检查防火墙设置或联系管理人员","提示",MB_ICONASTERISK);
return ;
} if ( fp_Download_URL_File != NULL )
{
fseek(fp_Download_URL_File, , SEEK_SET);
fread(Buf_File_Read,,,fp_Download_URL_File);
fclose(fp_Download_URL_File);
DeleteFile(szFilePath);
}
strcpy(g_szWanIp,Buf_File_Read);
}

最新文章

  1. 序言<EntityFramework6.0>
  2. c# TCP Socket通讯基础
  3. 命名空间 - PHP笔记
  4. C++ 设计模式2 (面向对象设计原则)
  5. React History
  6. 排序算法——QuickSort、MergeSort、HeapSort(C++实现)
  7. 动态sql语句
  8. ASP.Net Core WebApi几种版本控制对比
  9. cesium编程入门(四)界面介绍及小控件隐藏
  10. 认识Java(2)
  11. ●BZOJ 4176 Lucas的数论
  12. node-服务器
  13. fdisk -l 参数详解
  14. 转载:【原译】Erlang性能的八个误区(Efficiency Guide)
  15. 高级Bash脚本编程(一)
  16. FineReport移动端如何获取地址位置
  17. Codeforces 950.E Data Center Maintenance
  18. nginx结合fastcgi
  19. msysgit: Unicode font warning
  20. Python ssh 远程执行shell命令

热门文章

  1. 嵌入式Linux中摄像头使用简要整理【转】
  2. AsBcd的意思
  3. python接口自动化1-发送get请求【转载】
  4. python tips;matplotlib 显示中文
  5. vs code 在windows10 64bit系统配置python开发环境
  6. Spring:基于配置文件的创建对象的各种方式
  7. [COCI2015]JABUKE
  8. Android Developer -- Bluetooth篇 开发实例之二 连接设备
  9. Oracle、SQLServer、ArcSDE怎么查看版本、补丁
  10. red-lang