大漠插件是一个很不错的东西,在按键精灵和易语言里面用得很多,可以后台找图找字,写游戏自动脚本用得特别多。前面写一个微信的自动脚本,查了一些资料,易语言不太熟悉,按键精灵功能上可能不好实现,就找了些资料,大漠插件是可以用在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. Android错误之--Error retrieving parent for item: No resource found that matches the given name 'Theme.A

    错误提示:error: Error retrieving parent for item: No resource found that matches the given name 'Theme.A ...

  2. cocos2d-x 3.0 回调函数

    參考文章: http://blog.csdn.net/crayondeng/article/details/18767407 http://blog.csdn.net/star530/article/ ...

  3. Redis与Reactor模式

    Redis与Reactor模式 Jan 9, 2016 近期看了Redis的设计与实现,这本书写的还不错,看完后对Redis的理解有非常大的帮助. 另外,作者整理了一份Redis源代码凝视,大家能够c ...

  4. windows远程桌面如果超出最大连接数, 使用命令行mstsc /console登录即可

    远程桌面如果超出最大连接数, 使用命令行mstsc /console登录即可. (也可以用 mstsc /admin) 可以在运行里使用mstsc /console /v:IP:远程端口即可强制登录; ...

  5. poj 3468 A Simple Problem with Integers 【线段树-成段更新】

    题目:id=3468" target="_blank">poj 3468 A Simple Problem with Integers 题意:给出n个数.两种操作 ...

  6. 【最后的冲刺】android中excel表的导入和数据处理

    [最后的冲刺]android中excel表的导入和数据处理 ——学校课程的查询和修改 1.编写 The Class类把课程表courses.db当做一个实体类,hashcode和equals这两个类是 ...

  7. 教你用squid做CDN把公司做到上市

    我们都知道CDN(内容分发网络)是用来给网站加速用的,通过在现有的Internet中增加一层新的网络架构,将网站的内容发布到最接近用户的网络的“边缘”,使用户可以就近取得所需的内容,以提高用户访问网站 ...

  8. 【NOI2015】【寿司晚宴】【状压DP】

    Description 为了庆祝 NOI 的成功开幕,主办方为大家准备了一场寿司晚宴. 小 G 和小 W 作为參加 NOI 的选手,也被邀请參加了寿司晚宴. 在晚宴上,主办方为大家提供了 n−1 种不 ...

  9. [译]GLUT教程 - 改变窗体大小

    Lighthouse3d.com >> GLUT Tutorial >> Basics >> Resizing the Window 上一章的例子创建了两个窗体,命 ...

  10. Eclipse配置总结

       按照公司要求,开发环境使用Eclipse Juno版本,需要安装maven插件和RTC插件.      经过一下午的尝试,总结经验教训:        1.eclipse安装maven的m2ec ...