资源简介
C#编写,实现了远程控制 、桌面查看、 远程开关机、 按键记录、 鼠标控制,测试过能用,详细说明在包内,内有说明。以前5分太多了,现在改了
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net.Sockets;
using System.IO;
using System.Threading;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
namespace SocketCaptureClient
{
public partial class CaptureClientFrm : Form
{
#region 声明变量和调用的Windows库函数
private const int MOUSEEVENTF_LEFTDOWN = 0x0002; //模拟鼠标左键按下
private const int MOUSEEVENTF_LEFTUP = 0x0004; //模拟鼠标左键抬起
private const int MOUSEEVENTF_RIGHTDOWN = 0x0008; //模拟鼠标右键按下
private const int MOUSEEVENTF_RIGHTUP = 0x0010; //模拟鼠标右键抬起
//调用系统函数 将鼠标移动到相应位置
[DllImport ( “user32.dll“ EntryPoint = “SetCursorPos“ )]
public extern static bool SetCursorPos ( int x int y );
//调用系统函数 鼠标事件函数
[DllImport ( “user32“ EntryPoint = “mouse_event“ )]
private static extern int mouse_event ( int dwFlags int dx int dy int cButtons int dwExtraInfo );
#endregion
public CaptureClientFrm ( )
{
InitializeComponent ( );
ipAddress.Text = “192.168.0.16“;
nudPort.Value = 10001;
}
private string serveraddress = “192.168.0.16“;
private int serverport = 10001;//端口
private Thread tReceive;//处理线程
private TcpClient clientsocket;//client套接字
private NetworkStream ns;
private StreamReader sr;
private bool connected;
bool keepalive = true;
void InfoDeal ( string strRet )
{
string []sATmp =strRet.Split ( ‘_‘ );
if ( sATmp.Length == 2 )
{
try
{
if ( sATmp [ 0 ] == “Key“ )
{
try
{
KeyBoardClss.keyInput_single ( sATmp [ 1 ] );
}
catch ( Exception ex ) { MessageBox.Show ( ex.Message “ErrorInfo_InfoDeal“ MessageBoxButtons.OK MessageBoxIcon.Error ); }
}
else if ( sATmp [ 0 ] == “Timer“ )
{
bool isEnabled =bool.Parse ( sATmp [ 1 ] );
if ( timer1.Enabled != isEnabled )
timer1.Enabled = isEnabled;
}
}
catch ( Exception ex )
{
MessageBox.Show ( ex.Message “ErrorInfo_InfoDeal“ MessageBoxButtons.OK MessageBoxIcon.Error );
}
}
else if ( sATmp.Length >= 2 || sATmp.Length == 1 || sATmp.Length == 0 )
{
MouseClss.OperMouse ( strRet );
}
}
///
/// 接收信息
///
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6766 2002-01-09 10:54 简单的远程桌面\SocketCaptureMain\Com00.ICO
文件 7406 2010-03-04 13:38 简单的远程桌面\SocketCaptureMain\Com100.ICO
文件 7406 2002-01-09 10:54 简单的远程桌面\SocketCaptureMain\Com11.ICO
文件 498 2010-02-09 16:35 简单的远程桌面\SocketCaptureMain\Program.cs
文件 5772 2010-03-04 13:39 简单的远程桌面\SocketCaptureMain\SocketCaptureMain.csproj
文件 20667 2010-04-06 17:22 简单的远程桌面\SocketCaptureMain\SocketMainFrm.cs
文件 19255 2010-04-06 17:22 简单的远程桌面\SocketCaptureMain\SocketMainFrm.Designer.cs
文件 6209 2010-04-06 17:22 简单的远程桌面\SocketCaptureMain\SocketMainFrm.resx
文件 1150 2010-03-03 09:41 简单的远程桌面\SocketCaptureMain\Resources\00572.ico
文件 1150 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\Add_1.ico
文件 1150 2010-03-03 09:37 简单的远程桌面\SocketCaptureMain\Resources\calculation.ico
文件 23904 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\clock_hands.png
文件 1150 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\close.ico
文件 1150 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\Conn.ico
文件 2238 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\Connection.ICO
文件 1150 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\Disconn.ico
文件 766 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\DisConnection.ICO
文件 1150 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\DownFile.ico
文件 21357 2010-02-26 10:15 简单的远程桌面\SocketCaptureMain\Resources\DownUp.png
文件 1150 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\importUser.ico
文件 1150 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\Input.ico
文件 1150 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\Modfiy.ico
文件 766 2010-03-03 09:44 简单的远程桌面\SocketCaptureMain\Resources\Oth117.ICO
文件 1150 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\Output.ico
文件 1150 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\Outputxm
文件 1150 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\pause.ico
文件 1150 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\Query.ico
文件 1150 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\ReadData.ico
文件 1150 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\ReadInfo.ico
文件 1150 2010-02-26 10:13 简单的远程桌面\SocketCaptureMain\Resources\send.ico
............此处省略75个文件信息
评论
共有 条评论