一些技巧(5)
来源:互联网 发布:mac如何下载炉石传说 编辑:程序博客网 时间:2024/05/21 15:31
调用那个函数得到本机的IP
struct hostent *thisHost;
struct in_addr in;
char MyName[80];
char *IP,*ptr;
if(gethostname (MyName,80)==SOCKET_ERROR)
return NULL;
if(!(thisHost = gethostbyname(MyName)))
return NULL;
memset((void *)&in,sizeof(in),0);
in.s_addr=*((unsigned long *)thisHost->h_addr_list[0]);
if(!(ptr = inet_ntoa(in)))
return NULL;
IP = new char[strlen(ptr)+1],
strcpy(IP,ptr);
return IP;
======================================================================================================================
控制鼠标在屏幕的任何位置单击
BOOL SetCursorPos(int x/*水平位置*/,int y/*垂直位置*/);
BOOL SetCursor();
::PostMessage
struct hostent *thisHost;
struct in_addr in;
char MyName[80];
char *IP,*ptr;
if(gethostname (MyName,80)==SOCKET_ERROR)
return NULL;
if(!(thisHost = gethostbyname(MyName)))
return NULL;
memset((void *)&in,sizeof(in),0);
in.s_addr=*((unsigned long *)thisHost->h_addr_list[0]);
if(!(ptr = inet_ntoa(in)))
return NULL;
IP = new char[strlen(ptr)+1],
strcpy(IP,ptr);
return IP;
======================================================================================================================
控制鼠标在屏幕的任何位置单击
BOOL SetCursorPos(int x/*水平位置*/,int y/*垂直位置*/);
BOOL SetCursor();
::PostMessage
- 一些技巧(5)
- 一些技巧(不断更新)
- 一些技巧(2)
- 一些技巧(15)
- 一些技巧(14)
- 一些技巧(13)
- 一些技巧(12)
- 一些技巧(11)
- 一些技巧(10)
- 一些技巧(9)
- 一些技巧(8)
- 一些技巧(7)
- 一些技巧(6)
- 一些技巧(4)
- 一些技巧(3)
- 一些技巧(2)
- 一些技巧(1)
- markdown一些技巧(1)
- 【RUNDLL32】IE关闭后进程管理器中出现很多RUNDLL32文件
- 一些技巧(8)
- 程序员面试题精选(06)-判断整数序列是不是二元查找树的后序遍历结果
- 一些技巧(7)
- 一些技巧(6)
- 一些技巧(5)
- Spring中常用的hql查询方法 getHibernateTemplate()
- XERCESC
- 一些技巧(4)
- 一些技巧(3)
- 跪求 自动机械设计课设 茶叶方形袋包装机工作台间歇运动机构的设计
- 一些技巧(2)
- 一些技巧(1)
- SQL SERVER数据库