資源簡介
這是進程外Com服務(exe)編寫和調用的Demo程序,編寫調試思路以及步驟可查看
http://blog.csdn.net/shu19880720/article/details/79537277
下載后記得在本地注冊com以及修改本地注冊表,否則無法使用,注冊修改方法文章里也有的

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Windows.Forms;
namespace?Test
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????//方式1
????????????//System.Guid?guid?=?new?Guid(“12D783BB-33BF-4973-B38B-2A8F0BA926E4“);
????????????//System.Type?t?=?Type.GetTypeFromCLSID(guid?“127.0.0.1“?true);
????????????//dynamic?comobject?=?System.Activator.CreateInstance(t);
????????????//comobject.TestMethod();
????????????//dcomclass?myclass?=?(dcomclass)comobject;
????????????//方式2
????????????System.Type?t?=?Type.GetTypeFromProgID(“TestComServer.TestComVisibleClass“);
????????????dynamic?o?=?Activator.CreateInstance(t);
????????????o.TestMethod();
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????187??2018-02-01?16:47??TestComServer\Test\App.config
?????文件???????8192??2018-03-13?10:24??TestComServer\Test\bin\Debug\Test.exe
?????文件????????187??2018-02-01?16:47??TestComServer\Test\bin\Debug\Test.exe.config
?????文件??????26112??2018-03-13?10:24??TestComServer\Test\bin\Debug\Test.pdb
?????文件??????24216??2018-03-13?10:26??TestComServer\Test\bin\Debug\Test.vshost.exe
?????文件????????187??2018-02-01?16:47??TestComServer\Test\bin\Debug\Test.vshost.exe.config
?????文件????????490??2016-07-16?19:44??TestComServer\Test\bin\Debug\Test.vshost.exe.manifest
?????文件??????11264??2018-02-08?15:37??TestComServer\Test\bin\Debug\TestComServer.exe
?????文件????????187??2018-02-07?09:49??TestComServer\Test\bin\Debug\TestComServer.exe.config
?????文件??????34304??2018-02-08?15:14??TestComServer\Test\bin\Debug\TestComServer.pdb
?????文件???????2860??2018-02-08?10:57??TestComServer\Test\bin\Debug\TestComServer.tlb
?????文件??????24224??2018-02-08?10:40??TestComServer\Test\bin\Debug\TestComServer.vshost.exe
?????文件????????187??2018-02-07?09:49??TestComServer\Test\bin\Debug\TestComServer.vshost.exe.config
?????文件????????490??2016-07-16?19:44??TestComServer\Test\bin\Debug\TestComServer.vshost.exe.manifest
?????文件????????522??2018-02-07?14:48??TestComServer\Test\bin\Debug\注冊.bat
?????文件???????1713??2018-02-08?15:31??TestComServer\Test\bin\Debug\注冊表?.reg
?????文件???????1032??2018-02-08?10:59??TestComServer\Test\Form1.cs
?????文件???????2017??2018-02-01?16:51??TestComServer\Test\Form1.Designer.cs
?????文件???????5817??2018-02-01?16:51??TestComServer\Test\Form1.resx
?????文件???????7004??2018-03-13?10:26??TestComServer\Test\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件??????????0??2018-02-01?16:47??TestComServer\Test\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
?????文件??????????0??2018-02-01?16:47??TestComServer\Test\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
?????文件??????????0??2018-02-01?16:47??TestComServer\Test\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
?????文件???????2068??2018-03-13?10:26??TestComServer\Test\obj\Debug\Test.csproj.FileListAbsolute.txt
?????文件????????977??2018-02-08?15:15??TestComServer\Test\obj\Debug\Test.csproj.GenerateResource.Cache
?????文件???????2211??2018-03-13?10:24??TestComServer\Test\obj\Debug\Test.csprojResolveAssemblyReference.cache
?????文件???????8192??2018-03-13?10:24??TestComServer\Test\obj\Debug\Test.exe
?????文件????????180??2018-02-08?15:15??TestComServer\Test\obj\Debug\Test.Form1.resources
?????文件??????26112??2018-03-13?10:24??TestComServer\Test\obj\Debug\Test.pdb
?????文件????????180??2018-02-08?15:15??TestComServer\Test\obj\Debug\Test.Properties.Resources.resources
............此處省略61個文件信息
- 上一篇:Typora 主題
- 下一篇:深入.net平臺和C#編程課后練習答案
評論
共有 條評論