LocInfo.h
上传用户:fzchengxin
上传日期:2013-10-17
资源大小:2070k
文件大小:1k
源码类别:

Windows编程

开发平台:

Visual C++

  1. // LocInfo.h: interface for the LocInfo class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_LOCINFO_H__28CED33A_FE2D_4948_ABD2_E790A9F4724D__INCLUDED_)
  5. #define AFX_LOCINFO_H__28CED33A_FE2D_4948_ABD2_E790A9F4724D__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include <Afxtempl.h>
  10. typedef struct tagAdapterInfo
  11. {
  12. CString strName; // 适配器名称
  13. CString strDriverDesc; // 适配器描述
  14. CString strIP; // IP 地址
  15. CString strNetMask; // 子网掩码
  16. CString strNetGate; // 默认网关
  17. CString strDNSSever; //首选DNS服务器
  18. }ADAPTER_INFO;
  19. class LocInfo  
  20. {
  21. public:
  22. bool GetLocalIpAddr( char *pIP, int size );
  23. bool GetNextLocalIpAddr( char *pIP, int size );
  24. LocInfo();
  25. virtual ~LocInfo();
  26. private:
  27. bool Requery();
  28. bool GetAdapterInfo();
  29. bool RegGetIP( ADAPTER_INFO *pAI );
  30. // CString m_strIP;
  31. CArray<ADAPTER_INFO*, ADAPTER_INFO*> m_paAdapterInfo;//#include <Afxtempl.h> // CArray
  32. int m_nCurIndex; // 当前可用网卡的序号
  33. };
  34. #endif // !defined(AFX_LOCINFO_H__28CED33A_FE2D_4948_ABD2_E790A9F4724D__INCLUDED_)