資源簡介
C#對大漠的調用,比較復雜,最近項目中卻要用到,在網上搜了好久,終于找到一個實成的完整可用代碼.分享一下原作者的分享.

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
using?System.Runtime.InteropServices;
namespace?CShapDM
{
????///?
????///?大漠插件C#免注冊調用類
????///?本模塊必須包含dmc.dll?實現不用注冊dm.dll?到系統可以動態調用
????///?
????class?CDmSoft?:?IDisposable
????{
????????
????????#region?import?DLL?函數
????????[DllImport(“dmc.dll“CharSet?=?CharSet.Unicode?CallingConvention?=?CallingConvention.StdCall)]
????????public?static?extern?IntPtr?CreateDM(string?dmpath);
????????[DllImport(“dmc.dll“?CharSet?=?CharSet.Unicode?CallingConvention?=?CallingConvention.StdCall)]
????????public?static?extern?int?FreeDM();
????????[DllImport(“dmc.dll“?CharSet?=?CharSet.Unicode?CallingConvention?=?CallingConvention.StdCall)]
????????public?static?extern?string?Ver(IntPtr?dm);
????????[DllImport(“dmc.dll“?CharSet?=?CharSet.Unicode?CallingConvention?=?CallingConvention.StdCall)]
????????public?static?extern?int?SetPath(IntPtr?dmstring?path);
????????[DllImport(“dmc.dll“?CharSet?=?CharSet.Unicode?CallingConvention?=?CallingConvention.StdCall)]
????????public?static?extern?string?Ocr(IntPtr?dmint?x1int??y1int??x2int??y2string??colordouble?sim);
????????[DllImport(“dmc.dll“?CharSet?=?CharSet.Unicode?CallingConvention?=?CallingConvention.StdCall)]
????????public?static?extern?int?FindStr(IntPtr?dmint?x1int??y1int??x2int??y2string??strstring?colordouble??simout?object??xout?object??y);
????????[DllImport(“dmc.dll“?CharSet?=?CharSet.Unicode?CallingConvention?=?CallingConvention.StdCall)]
????????public?static?extern?int?GetResultCount(IntPtr?dmstring?str);
????????[DllImport(“dmc.dll“?CharSet?=?CharSet.Unicode?CallingConvention?=?CallingConvention.StdCall)]
????????public?static?extern?int?GetResultPos(IntPtr?dmstring?strint??indexout?object??xout?object?y);
????????[DllImport(“dmc.dll“?CharSet?=?CharSet.Unicode?CallingConvention?=?CallingConvention.StdCall)]
????????public?static?extern?int?StrStr(IntPtr?dmstring?sstring??str);
????????[DllImport(“dmc.dll“?CharSet?=?CharSet.Unicode?CallingConvention?=?CallingConvention.StdCall)]
????????public?static?extern?int?SendCommand(IntPtr?dmstring?cmd);
????????[DllImport(“dmc.dll“?CharSet?=?CharSet.Unicode?CallingConvention?=?CallingConvention.StdCall)]
????????public?static?extern?int?UseDict(IntPtr?dmint?index);
????????[DllImport(“dmc.dll“?CharSet?=?CharSet.Unicode?CallingConvention?=?CallingConvention.StdCall)]
????????public?static?extern?string?GetbasePath(IntPtr?dm);
????????[DllImport(“dmc.dll“?CharSet?=?CharSet.Unicode?CallingConvention?=?CallingConvention.StdCall)]
????????public?static?extern?int?SetDictPwd(IntPtr?dmstring?pwd);
????????[DllImport(“dmc.dll“?CharSet?=?CharSet.Unicode?CallingConvention?=?CallingConvention.StdCall)]
????????public?static?extern?string?OcrInFile(IntPtr?dmint?x1int??y1int??x2int??y2string??pic_namestring??colordouble??sim);
????????[DllIm
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????4846??2013-06-05?14:48??C#?調用大漠插件\03調用大漠插件\03調用大漠插件.csproj
?????文件????????227??2013-06-05?14:30??C#?調用大漠插件\03調用大漠插件\03調用大漠插件.csproj.user
?????文件???????6144??2015-11-18?15:59??C#?調用大漠插件\03調用大漠插件\03調用大漠插件.v11.suo
?????文件????????187??2013-06-04?14:17??C#?調用大漠插件\03調用大漠插件\App.config
?????文件??????76800??2015-11-18?15:36??C#?調用大漠插件\03調用大漠插件\bin\Debug\03調用大漠插件.exe
?????文件????????187??2013-06-04?14:17??C#?調用大漠插件\03調用大漠插件\bin\Debug\03調用大漠插件.exe.config
?????文件?????165376??2015-11-18?15:36??C#?調用大漠插件\03調用大漠插件\bin\Debug\03調用大漠插件.pdb
?????文件??????22984??2015-11-18?15:41??C#?調用大漠插件\03調用大漠插件\bin\Debug\03調用大漠插件.vshost.exe
?????文件????????187??2013-06-04?14:17??C#?調用大漠插件\03調用大漠插件\bin\Debug\03調用大漠插件.vshost.exe.config
?????文件????????490??2012-06-06?02:06??C#?調用大漠插件\03調用大漠插件\bin\Debug\03調用大漠插件.vshost.exe.manifest
?????文件?????823296??2013-06-04?14:18??C#?調用大漠插件\03調用大漠插件\bin\Debug\dm.dll
?????文件?????390656??2013-06-04?14:18??C#?調用大漠插件\03調用大漠插件\bin\Debug\dmc.dll
?????文件????1392159??2013-06-05?15:44??C#?調用大漠插件\03調用大漠插件\bin\Debug\screenshot.png
?????文件????????178??2013-06-05?14:48??C#?調用大漠插件\03調用大漠插件\bin\Debug\word.txt
?????文件???????2252??2013-06-04?15:14??C#?調用大漠插件\03調用大漠插件\bin\Debug\yuan.bmp
?????文件?????109231??2013-06-04?20:23??C#?調用大漠插件\03調用大漠插件\CDmSoft.cs
?????文件?????????60??2013-06-05?10:09??C#?調用大漠插件\03調用大漠插件\ClassDiagram1.cd
?????文件???????5633??2015-11-18?15:36??C#?調用大漠插件\03調用大漠插件\Form1.cs
?????文件???????9861??2015-11-18?15:36??C#?調用大漠插件\03調用大漠插件\Form1.Designer.cs
?????文件???????6165??2015-11-18?15:36??C#?調用大漠插件\03調用大漠插件\Form1.resx
?????文件????????402??2013-06-05?13:40??C#?調用大漠插件\03調用大漠插件\Form2.cs
?????文件???????2930??2013-06-05?13:40??C#?調用大漠插件\03調用大漠插件\Form2.Designer.cs
?????文件???????5817??2013-06-05?13:40??C#?調用大漠插件\03調用大漠插件\Form2.resx
?????文件????????402??2013-06-05?14:45??C#?調用大漠插件\03調用大漠插件\Form3.cs
?????文件???????2894??2013-06-05?14:45??C#?調用大漠插件\03調用大漠插件\Form3.Designer.cs
?????文件???????5817??2013-06-05?14:45??C#?調用大漠插件\03調用大漠插件\Form3.resx
?????文件???????3801??2015-11-18?15:41??C#?調用大漠插件\03調用大漠插件\obj\Debug\03調用大漠插件.csproj.FileListAbsolute.txt
?????文件???????1210??2015-11-18?15:36??C#?調用大漠插件\03調用大漠插件\obj\Debug\03調用大漠插件.csproj.GenerateResource.Cache
?????文件???????2209??2015-11-18?15:36??C#?調用大漠插件\03調用大漠插件\obj\Debug\03調用大漠插件.csprojResolveAssemblyReference.cache
?????文件??????76800??2015-11-18?15:36??C#?調用大漠插件\03調用大漠插件\obj\Debug\03調用大漠插件.exe
............此處省略36個文件信息
評論
共有 條評論