用发布版本生成的程序只有40K(不带图标),还不错吧?O(∩_∩)O哈!相信自己#include <stdio.h> #include <winsock2.h> #pragma comment( lib , "ws2_32" ) int main() { char Fs[1000]; char Js[1000]; WSADATA wsadata; SOCKET Socket; SOCKADDR_IN Local, to; { WSAStartup( 0x0202, &wsadata ); } Socket = socket( AF_INET, SOCK_STREAM, 0 ); if (!Socket) { return -1; } Local.sin_family = AF_INET; Local.sin_port = htons(102); Local.sin_addr.S_un.S_addr = htonl(INADDR_ANY); to.sin_family = AF_INET; to.sin_port = htons(80); to.sin_addr.S_un.S_addr = inet_addr("192.168.1.1"); if (bind(Socket, (SOCKADDR*)&Local, sizeof(Local)) == SOCKET_ERROR) { return -1; } if (connect(Socket, (SOCKADDR*)&to, sizeof(SOCKADDR)) == SOCKET_ERROR) { return -1; } { memset(Fs, 0, 1000); memset(Js, 0, 1000); strcpy(Fs, "GET /userRpm/SysRebootRpm.htm?Reboot=%D6%D8%C6%F4%C2%B7%D3%C9%C6%F7 HTTP/1.1\r\n" ); strcat(Fs, "Host: 192.168.1.1\r\n" ); strcat(Fs, "Authorization: Basic YWRtaW46YWRtaW4=\r\n" ); strcat(Fs, "\r\n"); } if (send(Socket, Fs, strlen(Fs), 0) == SOCKET_ERROR) { return -1; } closesocket(Socket); WSACleanup(); return 0; }