• 大小: 155KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-19
  • 语言: C#
  • 标签: 监控  源码  c#  屏幕  

资源简介

非常实用的远程屏幕监控含源码,可用来直接使用也可以用来学习研究

资源截图

代码片段和文件信息

/************************************************************/
//【项目】:远程监控
//【创建】:2005年10月
//【作者】:SmartKernel
//【邮箱】:smartkernel@126.com
//【QQ  】:120018689
//【MSN 】:smartkernel@hotmail.com
//【网站】:www.SmartKernel.com
/************************************************************/

using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.IO;
using System.Net.Sockets;
using System.Threading;

namespace SmartKernel.Net
{
    public class Monitor : System.MarshalByRefobject
    {
        #region 常量
        private const uint MOUSEEVENTF_MOVE       = 0x0001; //系统消息:鼠标移动
private const uint MOUSEEVENTF_LEFTDOWN   = 0x0002; //系统消息:左键按下
private const uint MOUSEEVENTF_LEFTUP     = 0x0004; //系统消息:左键放开
private const uint MOUSEEVENTF_RIGHTDOWN  = 0x0008; //系统消息:右键按下
private const uint MOUSEEVENTF_RIGHTUP    = 0x0010; //系统消息:右键放开
private const uint MOUSEEVENTF_MIDDLEDOWN = 0x0020; //系统消息:中间健按下
private const uint MOUSEEVENTF_MIDDLEUP   = 0x0040; //系统消息:中间健放开
private const uint MOUSEEVENTF_WHEEL      = 0x0800; //系统消息:滚动滚轮
private const uint MOUSEEVENTF_ABSOLUTE   = 0x8000; //指定鼠标坐标系统中的一个绝对位置
private const uint KEYEVENTF_EXTENDEDKEY  = 0x0001; //一个扩展键
private const uint KEYEVENTF_KEYUP        = 0x0002; //模拟松开一个键
private const uint INPUT_MOUSE   = 0;      //模拟鼠标事件
private const uint INPUT_KEYBOARD   = 1;      //模拟键盘事件
private static byte[] PreviousBitmapBytes = null;
        #endregion

        #region 构造函数
        public Monitor() 
{

        }
        #endregion

        #region Win32API方法包装
        [DllImport(“user32.dll“)]
        private static extern IntPtr GetDesktopWindow();

        [DllImport(“gdi32.dll“)]
        private static extern bool BitBlt
        (
            IntPtr hdcDest //指向目标设备环境的句柄
            int nXDest //指定目标矩形区域克上角的X轴逻辑坐标
            int nYDest //指定目标矩形区域左上角的Y轴逻辑坐标
            int nWidth //指定源和目标矩形区域的逻辑宽度
            int nHeight //指定源和目标矩形区域的逻辑高度
            IntPtr hdcSrc //指向源设备环境句柄
            int nXSrc //指定源矩形区域左上角的X轴逻辑坐标
            int nYSrc //指定源矩形区域左上角的Y轴逻辑坐标
            System.Int32 dwRop //指定光栅操作代码。这些代码将定义源矩形区域的颜色数据,如何与目标矩形区域的颜色数据组合以完成最后的颜色
        );

        [DllImport(“user32.dll“)]
        private static extern int GetSystemMetrics(int nIndex);

        [DllImport(“user32.dll“)]
        private static extern uint SendInput
        (
            uint nInputs
            ref INPUT input
            int cbSize
        );

        [DllImport(“user32.dll“)]
        private static extern void SetCursorPos(int x int y);
        #endregion

        #region Win32结构包装
        struct MOUSE_INPUT
        {
            public uint dx;
            public uint dy;
            public uint mouseData;
            public uint dwFlags;
            public uint time;
            public uint dwExtraInfo;
        }

        struct KEYBD_INPUT
        {
     

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       7168  2008-06-25 17:38  0009《远程屏幕监控》\代理类\bin\Debug\SmartKernel.Net.Monitor.dll

     文件      15872  2008-06-25 17:38  0009《远程屏幕监控》\代理类\bin\Debug\SmartKernel.Net.Monitor.pdb

     文件      20480  2007-09-02 19:30  0009《远程屏幕监控》\代理类\bin\Release\SmartKernel.Net.Monitor.dll

     文件      13824  2007-09-02 19:30  0009《远程屏幕监控》\代理类\bin\Release\SmartKernel.Net.Monitor.pdb

     文件       7998  2007-09-02 18:31  0009《远程屏幕监控》\代理类\Monitor.cs

     文件       7168  2008-06-25 17:38  0009《远程屏幕监控》\代理类\obj\Debug\SmartKernel.Net.Monitor.dll

     文件      15872  2008-06-25 17:38  0009《远程屏幕监控》\代理类\obj\Debug\SmartKernel.Net.Monitor.pdb

     文件        448  2008-06-25 17:38  0009《远程屏幕监控》\代理类\obj\Debug\代理类.csproj.FileListAbsolute.txt

     文件      20480  2007-09-02 19:30  0009《远程屏幕监控》\代理类\obj\Release\SmartKernel.Net.Monitor.dll

     文件      13824  2007-09-02 19:30  0009《远程屏幕监控》\代理类\obj\Release\SmartKernel.Net.Monitor.pdb

     文件        406  2007-09-02 19:30  0009《远程屏幕监控》\代理类\obj\代理类.csproj.FileList.txt

     文件       1321  2007-09-02 18:16  0009《远程屏幕监控》\代理类\Properties\AssemblyInfo.cs

     文件       2191  2008-06-25 17:38  0009《远程屏幕监控》\代理类\代理类.csproj

     文件       7168  2008-06-25 17:38  0009《远程屏幕监控》\受控端\bin\Debug\SmartKernel.Net.Monitor.dll

     文件      15872  2008-06-25 17:38  0009《远程屏幕监控》\受控端\bin\Debug\SmartKernel.Net.Monitor.pdb

     文件       5120  2008-06-25 17:38  0009《远程屏幕监控》\受控端\bin\Debug\受控端.exe

     文件      13824  2008-06-25 17:38  0009《远程屏幕监控》\受控端\bin\Debug\受控端.pdb

     文件      20480  2007-09-02 19:30  0009《远程屏幕监控》\受控端\bin\Release\SmartKernel.Net.Monitor.dll

     文件      15872  2007-09-02 19:30  0009《远程屏幕监控》\受控端\bin\Release\SmartKernel.Net.Monitor.pdb

     文件      16384  2008-05-18 15:12  0009《远程屏幕监控》\受控端\bin\Release\受控端.exe

     文件      11776  2007-09-02 19:30  0009《远程屏幕监控》\受控端\bin\Release\受控端.pdb

     文件        952  2007-09-02 18:54  0009《远程屏幕监控》\受控端\MonitorServer.cs

     文件       3255  2008-06-25 17:38  0009《远程屏幕监控》\受控端\obj\Debug\ResolveAssemblyReference.cache

     文件        570  2008-06-25 17:38  0009《远程屏幕监控》\受控端\obj\Debug\受控端.csproj.FileListAbsolute.txt

     文件       5120  2008-06-25 17:38  0009《远程屏幕监控》\受控端\obj\Debug\受控端.exe

     文件      13824  2008-06-25 17:38  0009《远程屏幕监控》\受控端\obj\Debug\受控端.pdb

     文件      16384  2008-05-18 15:12  0009《远程屏幕监控》\受控端\obj\Release\受控端.exe

     文件      11776  2007-09-02 19:30  0009《远程屏幕监控》\受控端\obj\Release\受控端.pdb

     文件        454  2007-09-02 19:30  0009《远程屏幕监控》\受控端\obj\受控端.csproj.FileList.txt

     文件       1173  2007-09-02 18:15  0009《远程屏幕监控》\受控端\Properties\AssemblyInfo.cs

............此处省略93个文件信息

评论

共有 条评论