⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 choose.cpp

📁 一个基于VC++开发的网络安全扫描程序!!!能够有效地发现网络安全漏洞
💻 CPP
字号:
// Choose.cpp : implementation file
//

#include "stdafx.h"
#include "BeastScaner.h"
#include "Choose.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CChoose dialog

IMPLEMENT_DYNAMIC(CChoose, CDialog)
CChoose::CChoose(pcap_if_t * DevHeader,CWnd* pParent /*=NULL*/)
	: CDialog(CChoose::IDD, pParent)
	, CurrentSel(0)
{
	this->DevHeader=DevHeader;
}

void CChoose::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CChoose)
	DDX_Control(pDX, IDC_COMBO1, ComboCtrl);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CChoose, CDialog)
	//{{AFX_MSG_MAP(CChoose)
	ON_BN_CLICKED(IDOK, OnBnClickedOk)
	ON_BN_CLICKED(IDCANCEL, OnBnClickedCancel)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CChoose message handlers

BOOL CChoose::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
		pcap_if_t *d;
	char strName[64];
	gethostname(strName,64);
	hostent* pHostEnt;
    pHostEnt = gethostbyname(strName);

	DWORD dwLocalIP=unsigned long(pHostEnt->h_addr_list[0][0] & 0XFF)*0x1000000+unsigned long(pHostEnt->h_addr_list[0][1] & 0XFF)*0x10000+unsigned long(pHostEnt->h_addr_list[0][2] & 0XFF)*0x100+unsigned long(pHostEnt->h_addr_list[0][3] & 0XFF);
	int i=0;
	for(d=this->DevHeader;d;d=d->next)
	{
		this->ComboCtrl.InsertString(i,d->description);//.AddString(d->description);
		i++;
	}
	this->ComboCtrl.SetCurSel(i-1);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CChoose::OnBnClickedOk() 
{
	// TODO: Add your control notification handler code here
	this->UpdateData();
	this->CurrentSel=this->ComboCtrl.GetCurSel();
	OnOK();
}

void CChoose::OnBnClickedCancel() 
{
	// TODO: Add your control notification handler code here
	OnCancel();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -