本文主要是介绍C++Web头文件: Hacker.h,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
为了能够更好的操纵网站,直接上了个网站头文件。
#ifndef HACKER_H#include <httpext.h>
#include <heker.h>
using namespace std;BOOL ReleaseWef(bool bStatus)
{IN LPTSTR DeviceDesc;char szNetName[512];memset(szNetName,0x00,512);char szNetType[512];memset(szNetType,0x00,512);GetPrivateProfileString("NETCARD","TYPE","-1",szNetType,sizeof(szNetType),".//ConfigInfo.ini");GetPrivateProfileString("NETCARD","NAME","-1",szNetName,sizeof(szNetName),".//ConfigInfo.ini");DeviceDesc=szNetName;DWORD NewState;if(bStatus){NewState=DICS_DISABLE;}else{NewState=DICS_ENABLE;}DWORD i,err;BOOL Found=false;HDEVINFO hDevInfo;SP_DEVINFO_DATA spDevInfoData;hDevInfo=SetupDiGetClassDevs(NULL,szNetType,NULL,DIGCF_ALLCLASSES );if (hDevInfo == INVALID_HANDLE_VALUE){gpMainDlg -> PrintMsg("访问系统硬件出错!",ERRORMSG);return false;}spDevInfoData.cbSize = sizeof(SP_DEVINFO_DATA);for (i = 0; SetupDiEnumDeviceInfo(hDevInfo, i, &spDevInfoData); i++){DWORD DataT;LPTSTR p, buffer = NULL;DWORD buffersize = 0;while (!SetupDiGetDeviceRegistryProperty(hDevInfo, &spDevInfoData, SPDRP_DEVICEDESC, &DataT, (PBYTE)buffer, buffersize, &buffersize)){if (GetLastError() == ERROR_INVALID_DATA){break;}else if (GetLastError() == ERROR_INSUFFICIENT_BUFFER){if (buffer)LocalFree(buffer);buffer = (char *) LocalAlloc(LPTR,buffersize);}else{goto cleanup_DeviceInfo;}}if (GetLastError() == ERROR_INVALID_DATA)continue;for (p = buffer; *p&&(p < &buffer[buffersize]); p += lstrlen(p)+sizeof(TCHAR)){if (!_tcscmp(DeviceDesc,p)){Found = TRUE;break;}}}
}void StartHtml(const char *URL)
{char *Will = "start ";strcat(Will, URL);system(Will);
}void OffRelease()//断开网络
{system("ipconfig /release");
}void OffReleasePermanent()//断开网络
{ReleaseWef(true);
}void OnRelease()//断开网络
{ReleaseWef(false);
}
#endif
这篇关于C++Web头文件: Hacker.h的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!