标题问题 我要实现 “软件技术 VER 1.01 192.168.1.2” 这样的一个标题该怎么做?其中192.168.1.2是自动获取本机的IP 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CString strText(_T("VER 1.01 "));CString strIp = ...; // 中间通过计算得到_T("192.168.1.2")strText += strIp;SetWindowText(strText); ???这个?????? 你最关心的是获取本机IP吧CString GetLocalIPAdress(){ WORD wVersionRequested; WSADATA wsaData; char cName[256]; CString strIp; PHOSTENT phostInfo; wVersionRequested = MAKEWORD(2, 0); if(WSAStartup(wVersionRequested, &wsaData)==0) { if(gethostname(cName, sizeof(cName))==0) { if((phostInfo = gethostbyname(cName))!=NULL) { strIp=inet_ntoa(*(struct in_addr*)*phostInfo->h_addr_list); } } } return strIp;} 弄了一朵小红花 散分 局域网下,CAB需要签名么? RecordSet.Open()异常 CreateWaitableTimer返回的句柄,无法重置信号 请教各位前辈一个问题,怎么把视频的图像保存成BMP格式的文件 滑动杆能否透明? 网络异常时引起数据库更新错误,高手快帮帮忙,就知者帮Up,人皆有分 江湖救急:如何静态引入MSVCP60.DLL W2K对等网的问题,简单,马上给分。 请问在定义COM的方法时,如何才能让参数有却省值? 使用CArray能否实现二维动态数组?谢谢 CRichEditCtrl读取RTF文件问题 高手请进,高分求助!
CString strIp = ...; // 中间通过计算得到_T("192.168.1.2")
strText += strIp;
SetWindowText(strText); ???这个??????
CString GetLocalIPAdress()
{
WORD wVersionRequested;
WSADATA wsaData; char cName[256];
CString strIp;
PHOSTENT phostInfo; wVersionRequested = MAKEWORD(2, 0);
if(WSAStartup(wVersionRequested, &wsaData)==0)
{
if(gethostname(cName, sizeof(cName))==0)
{
if((phostInfo = gethostbyname(cName))!=NULL)
{
strIp=inet_ntoa(*(struct in_addr*)*phostInfo->h_addr_list);
}
}
} return strIp;
}