大漠插件是一个很不错的东西,在按键精灵和易语言里面用得很多,可以后台找图找字,写游戏自动脚本用得特别多。前面写一个微信的自动脚本,查了一些资料,易语言不太熟悉,按键精灵功能上可能不好实现,就找了些资料,大漠插件是可以用在C#里的调用的。这里分享下方法。

一、引用Ddm.dll
.NET里面可以直接引用,引用方法,添加引用--COM--找到DM,双击即可
二、注册大漠插件
//这是注册DLL到系统的一个方法,注册大漠则调用 AutoRegCom("regsvr32 -s dm.dll");
static string AutoRegCom(string strCmd)
{
string rInfo; try
{
Process myProcess = new Process();
ProcessStartInfo myProcessStartInfo = new ProcessStartInfo("cmd.exe");
myProcessStartInfo.UseShellExecute = false;
myProcessStartInfo.CreateNoWindow = true;
myProcessStartInfo.RedirectStandardOutput = true;
myProcess.StartInfo = myProcessStartInfo;
myProcessStartInfo.Arguments = "/c " + strCmd;
myProcess.Start();
StreamReader myStreamReader = myProcess.StandardOutput;
rInfo = myStreamReader.ReadToEnd();
myProcess.Close();
rInfo = strCmd + "\r\n" + rInfo;
return rInfo;
}
catch (Exception ex)
{
return ex.Message;
}
}
三、实例化大漠对象
Dm.dmsoft dm = new Dm.dmsoft();
四、调用大漠的方法

直接通过实例化的对象dm调用,如dm.MoveTo(30, 30);

完整代码: 窗体上放一个按钮,点击按钮,调用大漠插件将鼠标移动到(30,30)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.IO; namespace Player
{
public partial class Player : Form
{
public Player()
{
InitializeComponent();
AutoRegCom("regsvr32 -s dm.dll");
} private void button1_Click(object sender, EventArgs e)
{
Dm.dmsoft dm = new Dm.dmsoft();
dm.MoveTo(, ); } static string AutoRegCom(string strCmd)
{
string rInfo; try
{
Process myProcess = new Process();
ProcessStartInfo myProcessStartInfo = new ProcessStartInfo("cmd.exe");
myProcessStartInfo.UseShellExecute = false;
myProcessStartInfo.CreateNoWindow = true;
myProcessStartInfo.RedirectStandardOutput = true;
myProcess.StartInfo = myProcessStartInfo;
myProcessStartInfo.Arguments = "/c " + strCmd;
myProcess.Start();
StreamReader myStreamReader = myProcess.StandardOutput;
rInfo = myStreamReader.ReadToEnd();
myProcess.Close();
rInfo = strCmd + "\r\n" + rInfo;
return rInfo;
}
catch (Exception ex)
{
return ex.Message;
}
}
}
}

C#调用大漠插件的更多相关文章

  1. C#调用大漠插件的方法和实例

    大漠插件是一个很不错的东西,在按键精灵和易语言里面用得很多,可以后台找图找字,写游戏自动脚本用得特别多.前面写一个微信的自动脚本,查了一些资料,易语言不太熟悉,按键精灵功能上可能不好实现,就找了些资料 ...

  2. Delphi调用大漠插件示例

    Delphi XE2 版本调用大漠插件方法:打开Component->Import Component->默认Import a Type Library,点击Next->找到Dm.d ...

  3. Python调用大漠插件

    Python版本要用32位的?我去官网下载,太慢了,就在腾讯软件里面下载了一个,结果实验成功 import win32com.client dm = win32com.client.Dispatch( ...

  4. C#调用大漠插件,发送QQ和微信消息

    大漠插件就不过多介绍了,不知道的请查下百度.主要是讲解C#怎么调用大漠插件. 大漠插件提供了COM版本,C#直接点击引用,添加即可.然后注册下大漠插件到系统文件夹,注册代码如下: static str ...

  5. python调用大漠插件教程03窗口绑定实例

    怎样利用注册好的大漠对象来绑定窗口? 直接上代码,根据代码分析 from win32com.client import Dispatch import os from win32gui import ...

  6. 调用大漠插件发送QQ和微信消息 C#版

    大漠插件:3.1233 找图,找色,识字,找字,窗口,按鼠标,按键盘 0.注册dm.dll: regsvr32 xxx\dm.dll 1.添加com引用: 2.dmsoft各种调用: 原理: 查找窗口 ...

  7. python调用大漠插件教程02大漠插件绑定测试工具

    什么是大漠插件绑定测试工具? 这是大漠插件为了方便使用者调试绑定窗口的模式而设计的,因为有些程序不会接受一般的鼠键事件的响应模式,每个程序所需要的响应模式都不尽相同,所以这个工具可以使我们在绑定窗口时 ...

  8. python调用大漠插件教程01注册大漠

    使用大漠有两种方法,一种是直接调用特殊的dll实现不注册就能使(本人不会),另一种则是注册后使用. 如何用python注册大漠? from win32com.client import Dispatc ...

  9. python调用大漠插件教程04鼠键事件及基本项目思维

    from win32com.client import Dispatch import os from random import uniform from time import sleep cla ...

随机推荐

  1. c#实现记事本

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  2. WCF获取元数据

    所谓获取WCF的服务元数据(Metadata),归根结点,实际上就是获取服务的终结点(Endpoint)的信息,这是服务公开在外的数据信息,包括Address.Binding与Contract,也就是 ...

  3. iOS 最新公布app到AppStore全流程具体解释

    一.生成公布证书(证书的作用:类似于驾照,证明你的身份能够进行开发人员一些操作) 打开https://developer.apple.com 点击右上角开发人员中心 这里输入你付款过的Apple 帐号 ...

  4. Python基础之迭代器

    迭代器的优点: 1.可以使用for循环遍历: 2.可以节省内存空间: 3.可以有序的访问集合(set)数据结构内的元素. 迭代器的缺点: 只能向前,不能后退. 可迭代对象与不可迭代对象: 可迭代对象: ...

  5. html+JS刷图实现视频效果

    网页播放视频须要载入播放器,可是通过刷图也能实现视频播放的效果 JS中用到Z-index属性,记录一篇解说Z-index属性的博客的地址: http://www.cnblogs.com/gisdrea ...

  6. Spring Boot 如何在类中应用配置文件

    如何在类中应用配置文件 优先级: 当前目录子目录的/config > 当前目录 > classpath的/config包 > classpath的根目录 即:越靠近的优先级越高 ** ...

  7. URL重写:Rewirte模块原理详解

    Apache+PHP+MySQL Rewirte主要的功能就是实现URL的跳转和隐藏真实地址,基于Perl语言的正则表达式规范.平时帮助我们实现拟静态,拟目录,域名跳转,防止盗链等.本文将针对mod_ ...

  8. ubuntu安装中文man手册

    1.安装manpages-zh包 sudo apt-get install manpages-zh 2.修改manpath文件 执行如下命令: vi /etc/manpath.config %s+/u ...

  9. sublime text 配置golang开发环境

    一.准备工作: 1.下载Go语言包: https://code.google.com/p/go/downloads/list 2.下载Git: https://code.google.com/p/ms ...

  10. linux授权某个用户对某个目录有读写的权限

    针对特定的某一个用户设置文件或目录权限,用setfacl. 首先打开文件系统的acl功能,在挂载参数添加cal,再保存退出,比如/home分区: vim /etc/fstab /dev/sda2 /h ...