为了自由,幸福而不断奋斗,前行!!!

一笑看风云过....

博客园 首页 新随笔 联系 订阅 管理

CIPAddressCtrl --> CString

void g_IPToStr(DWORD dip, char outbuf[16])
{
 ZeroMemory(outbuf,16);
 WORD add1,add2,add3,add4;
 //WORD   A 16-bit unsigned integer.
 //DWORD   A 32-bit unsigned integer or the address of a segment and its associated offset.


 add1=(WORD)(dip&255);
 add2=(WORD)((dip>>8)&255);
 add3=(WORD)((dip>>16)&255);
 add4=(WORD)((dip>>24)&255);
 sprintf(outbuf,"%d.%d.%d.%d",add4,add3,add2,add1);
}

posted on 2008-05-22 20:45  YAO'STAR  阅读(341)  评论(0编辑  收藏  举报