资源简介
远程控制分为客户端和服务器端,通过客户端登陆服务器端
代码片段和文件信息
// 从服务器端接收桌面屏幕
#include
#include
#include
#include “client.h“
#include “command.h“
#include “gdi.h“
#include “HuffCompress.h“
#include “RLE.h“
#include “time.h“
#define DEFAULT_PORT 5150
#define REFRESH_MSG “REFRESH“
#define SETFLAGS XP1_GUARANTEED_DELIVERY|XP1_GUARANTEED_ORDER
#define NOTSETFLAGS XP1_CONNECTIONLESS
#define LPBMIH LPBITMAPINFOHEADER
UINT port=DEFAULT_PORT;
BOOL bSendOnly = FALSE;
BOOL fSending = FALSE;
BOOL fReceiving = FALSE;
DWORD iLen;
char *pDIBitmap;
int iScreenWidthiScreenHeight;
int iWidthiHeightiWidthXiHeightY;
int iWidth1iWidth2iHeight1iHeight2;
int iCompressionLevel;
BOOL fDIBitmap = FALSE;
LPBMIH lpBitmapIH;
struct sockaddr_in server;
SOCKET sClient;
BOOL fRefreshing = FALSE;
BOOL fConnected = FALSE;
int nGridX = 8nGridY = 4;
BOOL fGridX = FALSEfGridY = FALSE;
WORD bmBitsPixel = 4;
struct GdiList GdiStart;
struct GdiList *pGdiNode;
int SelectProtocols(DWORD dwSetFlagsDWORD dwNotSetFlagsLPWSAPROTOCOL_INFO lpProtocolBufferLPDWORD lpdwBufferLengthWSAPROTOCOL_INFO *Protocol);
void InitGrids()
{
int iLoopjLoopnGrid;
struct GdiDS Gdi;
Gdi.fDIBitmap = FALSE;
GdiStart.pNext = NULL;
pGdiNode = &GdiStart;
if ((nGridX > 0) && (nGridY > 0))
{
for (iLoop = 0;iLoop < nGridX;iLoop++)
{
for (jLoop = 0;jLoop < nGridY;jLoop++)
{
Gdi.iGridX = iLoop;
Gdi.iGridY = jLoop;
pGdiNode = Add_Gdi(pGdiNodeGdi);
}
}
}
else
{
nGrid = max(nGridXnGridY);
for (iLoop = 0;iLoop < nGrid;iLoop++)
{
if (nGridX > 0)
Gdi.iGridX = iLoop;
else
Gdi.iGridX = 0;
if (nGridY > 0)
Gdi.iGridY = iLoop;
else
Gdi.iGridY = 0;
pGdiNode = Add_Gdi(pGdiNodeGdi);
}
}
if (nGridX > 0)
iWidthX = iWidth/nGridX;
else
iWidthX = iWidth;
if (nGridY > 0)
iHeightY = iHeight/nGridY;
else
iHeightY = iHeight;
}
// 装入Winsock然后连接服务器
int LoadWinsock(HWND hWndchar *szIP)
{
WSADATA wsd;
DWORD dwLen;
int nRetnZero;
LPBYTE pBuf;
WSAPROTOCOL_INFO Protocol;
char szString[81];
char szMessage[81];
if (WSAStartup(0x202&wsd) != 0)
{
MessageBox(NULL“hehe““Client Socket Error“MB_OK);
return 1;
}
dwLen = 0;
nRet = WSAEnumProtocols(NULLNULL&dwLen);
if (nRet == SOCKET_ERROR)
{
if (WSAGetLastError() != WSAENOBUFS)
return 1;
}
pBuf = malloc(dwLen);
nRet = SelectProtocols(SETFLAGSNOTSETFLAGS(LPWSAPROTOCOL_INFO)pBuf&dwLen&Protocol);
free(pBuf);
sClient = WSASocket(AF_INETSOCK_STREAMIPPROTO_IPNULL0SOCK_STREAM);
if (sClient == INVALID_SOCKET)
return 1;
nZero = 0;
setsockopt(sClientSOL_SOCKETSO_RCVBUF(char *)&nZerosizeof(nZero));
server.sin_family = AF_INET;
server.sin_port = htons(port);
server.sin_addr.s_addr = inet_addr(szIP);
if (connect(sClient(struct sockaddr *)&serversizeof(server)) == SOCKET_ERROR)
{
me
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 52 2000-03-09 16:14 RemoteControl\Client\RemoteControlClient\afiedt.buf
文件 15081 2003-07-10 16:55 RemoteControl\Client\RemoteControlClient\client.c
文件 688 2003-07-10 14:11 RemoteControl\Client\RemoteControlClient\client.h
文件 5497 2000-05-01 08:46 RemoteControl\Client\RemoteControlClient\ClientWindow.001
文件 5803 2003-07-09 17:45 RemoteControl\Client\RemoteControlClient\ClientWindow.dsp
文件 547 2000-05-01 13:04 RemoteControl\Client\RemoteControlClient\ClientWindow.dsw
文件 7290 2000-01-18 09:19 RemoteControl\Client\RemoteControlClient\ClientWindow.mak
文件 238592 2003-07-11 18:02 RemoteControl\Client\RemoteControlClient\ClientWindow.ncb
文件 61952 2003-07-11 18:02 RemoteControl\Client\RemoteControlClient\ClientWindow.opt
文件 1975 2003-07-10 19:49 RemoteControl\Client\RemoteControlClient\ClientWindow.plg
文件 781 2003-07-10 15:45 RemoteControl\Client\RemoteControlClient\ColorMode.cpp
文件 391 2003-07-10 15:46 RemoteControl\Client\RemoteControlClient\ColorMode.h
文件 600 2003-07-10 15:47 RemoteControl\Client\RemoteControlClient\Command.c
文件 350 2003-07-10 15:45 RemoteControl\Client\RemoteControlClient\Command.h
文件 1709 2003-07-11 13:26 RemoteControl\Client\RemoteControlClient\Compression.cpp
文件 389 2003-07-10 15:46 RemoteControl\Client\RemoteControlClient\Compression.h
文件 1007 2003-07-10 15:47 RemoteControl\Client\RemoteControlClient\Gdi.c
文件 498 2003-07-10 15:46 RemoteControl\Client\RemoteControlClient\Gdi.h
文件 1596 2003-07-10 15:50 RemoteControl\Client\RemoteControlClient\GridSpacing.cpp
文件 537 2003-07-10 15:48 RemoteControl\Client\RemoteControlClient\GridSpacing.h
文件 23839 2003-07-10 15:52 RemoteControl\Client\RemoteControlClient\HuffCompress.c
文件 958 2003-07-10 15:50 RemoteControl\Client\RemoteControlClient\HuffCompress.h
文件 468 2000-01-21 12:57 RemoteControl\Client\RemoteControlClient\IDB_NORECEIVE.BMP
文件 468 2000-01-21 12:57 RemoteControl\Client\RemoteControlClient\IDB_NOSEND.BMP
文件 468 2000-01-21 12:57 RemoteControl\Client\RemoteControlClient\IDB_RECEIVE.BMP
文件 468 2000-01-21 12:57 RemoteControl\Client\RemoteControlClient\IDB_SEND.BMP
文件 17193 2003-07-10 16:41 RemoteControl\Client\RemoteControlClient\MainWnd.cpp
文件 1956 2003-07-10 15:52 RemoteControl\Client\RemoteControlClient\MainWnd.h
文件 1078 2003-07-09 17:27 RemoteControl\Client\RemoteControlClient\Myfr
文件 2013 2003-07-09 17:27 RemoteControl\Client\RemoteControlClient\resource.h
............此处省略54个文件信息
- 上一篇:自己写的远控代码 C++
- 下一篇:实现用c++产生高斯噪声
相关资源
- 实现用c++产生高斯噪声
- 自己写的远控代码 C++
- C++课程设计公司人员管理系统
- C++程序设计 Y.Daniel Liang著 习题答案
- 纯C++方式生成复杂格式的excel文件(
- 清华大学C++课件
- 多级反馈队列调度算法C语言源代码
- g711音频编解码(C/C++)实现
- VC++ MFC MSCOMM VS2010 手把手学会串口收发
- 车辆信息管理系统课程设计完整源代
- C++ 家庭理财管理系统
- 基于C语言的录音播放程序--源代码
- 基于VisualC++ 6.0的服装试穿管理系统
- 64bit linux libstdc++.so.6.0.10
- Linux下C语言应用编程--随书源代码
- VC++解析并显示JPEG图片showjpeg.rar
- C++写的车辆信息管理系统
- 学生选课管理系统C++
- 面向对象C++笔记
- vc++能够显示网页html
- C++屏幕抓屏软件源代码
- 新安江模型修改
- C++仿最新版360安全卫士主界面基于稍
- codeblocks写的c语言小游戏源代码
- c语言迷宫游戏源代码
- VCLSkin 5.60.for.Delphi.C++Builder 5-2010 Full
- Boost Asio C++ 网络编程 中文最新版 PD
- 递归高斯模糊源代码最快速的高斯模
- C++使用ADO连接Access数据库源代码(修
- Linux串口操作RS232-C++
评论
共有 条评论