惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
A
About on SuperTechFans
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Blog — PlanetScale
Blog — PlanetScale
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
G
Google Developers Blog
J
Java Code Geeks
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
Cloudbric
Cloudbric
L
LINUX DO - 最新话题
MyScale Blog
MyScale Blog
H
Heimdal Security Blog
PCI Perspectives
PCI Perspectives
Attack and Defense Labs
Attack and Defense Labs
S
Security @ Cisco Blogs
Latest news
Latest news
I
Intezer
L
Lohrmann on Cybersecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
月光博客
月光博客
T
Threatpost
博客园 - 【当耐特】
S
Schneier on Security
P
Privacy International News Feed
G
GRAHAM CLULEY
T
Tenable Blog
AWS News Blog
AWS News Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
博客园 - Franky
Engineering at Meta
Engineering at Meta
美团技术团队
S
Secure Thoughts
T
Troy Hunt's Blog
Microsoft Security Blog
Microsoft Security Blog
SecWiki News
SecWiki News
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Cisco Talos Blog
Cisco Talos Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Martin Fowler
Martin Fowler
Webroot Blog
Webroot Blog
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - 生活即技术

好久不更新了,忙的惭愧哦,思考一个应用 利用dataTable 排序的解决方法 项目中遇到的一些小问题及解决方法 常用代码 部署Com+ 2004我的爱,2005我的期待 加密解密相关 生成略缩图 论坛在线人数统计代码 上礼拜六犯的愚蠢错误 正则表达式(1) 又一新的分页方法(转帖) 用户控件的使用(二) 用户控件的使用(一) DataList的使用(二)自定义分页的实现 DataList的使用(1) DataGrid的使用(2)自定义分页 DataGrid的使用(1)
一个com+消息队列的例子
生活即技术 · 2005-04-27 · via 博客园 - 生活即技术

  最近在研究com+和消息队列,于是就做了个例子。
  com+和消息队列结构是:
 首先服务器端安装com+和消息队列服务器,而客户端安装com+服务的代理和消息队列服务器。
  com+和消息队列的工作过程是:
 
客户端构造成个消息放到本机的发送消息队列中,客户端发送消息队列负责发该消息发送到com+服务器上,
 com+ 服务器消息队列接受客户端的消息。com+负责侦听消息,如用消息到达,就处理。 

代码如下:
 一.  
 1.服务器端.新建类库项目ServerLibrary2

 

 2,  用 sn -k "路径+文件名"  生成强类型的程序集,在AssemblyInfo.cs 文件中加[assembly: AssemblyKeyFile(@"c:\key.snk")]

 2. 生成 Serverlibrary2.dll
 
 3. 注册 regsvcs serverlibrary2.dll.
 
  说明:机器上必须安装消息队列服务器。

二. 客户端 
 
   1.客户端代码
  try
   {
      //用接口调用
    ServerLibrary2.IQComponent IQC= (IQComponent)Marshal.BindToMoniker("queue:/new:ServerLibrary2.QCSimpleDemo");
                int num=0;

    num=int.Parse(this.textBox2.Text);
      
    IQC.ComplicatedFunction(num);

    Marshal.ReleaseComObject(IQC);

                MessageBox.Show("转帐成功!!");
   }

   catch (Exception ex)
   {
    MessageBox.Show(ex.Message);
   
   }
  
  说明:Marshal.BindToMoniker 是System.Runtime.InteropServices下的一个方法。它获取一个指针。
      Marshal.ReleaseComObject(IQC); 释放对象引用数
  欢迎讨论: showstrong@hotmail.com