資源簡(jiǎn)介
自己學(xué)習(xí)編寫的主機(jī)掃描程序。MFC下,利用ICMP協(xié)議實(shí)現(xiàn),代碼簡(jiǎn)單。采用多線程編程,執(zhí)行速度較快。
代碼片段和文件信息
//?Scan.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“Scan.h“
#include?“ScanDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CScanApp
BEGIN_MESSAGE_MAP(CScanApp?CWinApp)
//{{AFX_MSG_MAP(CScanApp)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code!
//}}AFX_MSG
ON_COMMAND(ID_HELP?CWinApp::onhelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CScanApp?construction
CScanApp::CScanApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CScanApp?object
CScanApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CScanApp?initialization
BOOL?CScanApp::InitInstance()
{
????if?(!AfxSocketInit())
{
AfxMessageBox(“加載套接字庫(kù)失敗!“);
return?FALSE;
}
AfxEnableControlContainer();
//?Standard?initialization
//?If?you?are?not?using?these?features?and?wish?to?reduce?the?size
//??of?your?final?executable?you?should?remove?from?the?following
//??the?specific?initialization?routines?you?do?not?need.
#ifdef?_AFXDLL
Enable3dControls(); //?Call?this?when?using?MFC?in?a?shared?DLL
#else
Enable3dControlsStatic(); //?Call?this?when?linking?to?MFC?statically
#endif
CScanDlg?dlg;
m_pMainWnd?=?&dlg;
int?nResponse?=?dlg.DoModal();
if?(nResponse?==?IDOK)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?OK
}
else?if?(nResponse?==?IDCANCEL)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?Cancel
}
//?Since?the?dialog?has?been?closed?return?FALSE?so?that?we?exit?the
//??application?rather?than?start?the?application‘s?message?pump.
return?FALSE;
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????3543??2009-03-21?11:55??Scan\ReadMe.txt
?????文件???????1078??2009-03-21?11:55??Scan\res\Scan.ico
?????文件????????396??2009-03-21?11:55??Scan\res\Scan.rc2
?????文件????????912??2009-03-29?15:44??Scan\resource.h
?????文件??????36212??2009-03-29?15:50??Scan\Scan.aps
?????文件???????1378??2009-03-29?16:13??Scan\Scan.clw
?????文件???????2127??2009-03-22?11:38??Scan\Scan.cpp
?????文件???????4124??2009-03-23?12:13??Scan\Scan.dsp
?????文件????????533??2009-03-21?11:55??Scan\Scan.dsw
?????文件???????1302??2009-03-21?11:55??Scan\Scan.h
?????文件??????66560??2009-03-29?16:15??Scan\Scan.ncb
?????文件??????49664??2009-03-29?16:15??Scan\Scan.opt
?????文件???????1139??2009-03-29?16:14??Scan\Scan.plg
?????文件???????5876??2009-03-29?15:50??Scan\Scan.rc
?????文件???????9087??2009-03-29?16:14??Scan\ScanDlg.cpp
?????文件???????1749??2009-03-29?15:44??Scan\ScanDlg.h
?????文件????????206??2009-03-21?11:55??Scan\StdAfx.cpp
?????文件???????2709??2009-03-22?11:30??Scan\StdAfx.h
?????目錄??????????0??2009-03-23?20:29??Scan\res
?????目錄??????????0??2009-03-29?16:15??Scan
-----------?---------??----------?-----??----
???????????????188595????????????????????20
評(píng)論
共有 條評(píng)論