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

📄 socketfun.cpp

📁 几年前用vc6写的漏洞扫描器
💻 CPP
字号:
// SocketFun.cpp: implementation of the CSocketFun class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "try4.h"
#include "SocketFun.h"

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CSocketFun::CSocketFun()
{

}

CSocketFun::~CSocketFun()
{

}

int CSocketFun::StartUp()
{
	WORD    wVersionRequested;
	WSADATA wsaData;
	int     err; 
	
	wVersionRequested = MAKEWORD( 2, 0 ); 
	err = WSAStartup( wVersionRequested, &wsaData );
	if ( err != 0 ) {
		// Couldn't find a usable WinSock DLL.                                  */    
		return err;
	} 

	// Confirm that the WinSock DLL supports 2.0.
	// Note that if the DLL supports versions greater
	// than 2.0 in addition to 2.0, it will still return
	// 2.0 in wVersion since that is the version we
	// requested. 
	if ( LOBYTE( wsaData.wVersion ) != 2 ||
        HIBYTE( wsaData.wVersion ) != 0 ) {
		// Couldn't find a usable WinSock DLL.
		WSACleanup( );
		return WSAVERNOTSUPPORTED; 
	} 
	
	// The WinSock DLL is acceptable
	return 0;

}

int CSocketFun::CleanUp()
{
	int nRetCode;
	nRetCode = WSACleanup();
	if (nRetCode != 0) {
		// An error occured. 
		return WSAGetLastError();
	}

	return 0; 
}

⌨️ 快捷键说明

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