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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
V
V2EX
G
Google Developers Blog
F
Full Disclosure
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
H
Hacker News: Front Page
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
NISL@THU
NISL@THU
G
GRAHAM CLULEY
V
Vulnerabilities – Threatpost
Hacker News - Newest:
Hacker News - Newest: "LLM"
A
About on SuperTechFans
The Cloudflare Blog
C
Cisco Blogs
D
DataBreaches.Net
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Vercel News
Vercel News
P
Privacy International News Feed
Microsoft Security Blog
Microsoft Security Blog
Help Net Security
Help Net Security
Recorded Future
Recorded Future
PCI Perspectives
PCI Perspectives
S
Schneier on Security
AI
AI
N
News | PayPal Newsroom
雷峰网
雷峰网
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
The Last Watchdog
The Last Watchdog
L
LINUX DO - 最新话题
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
Schneier on Security
Schneier on Security
S
Securelist
云风的 BLOG
云风的 BLOG
Stack Overflow Blog
Stack Overflow Blog
博客园_首页
AWS News Blog
AWS News Blog
TaoSecurity Blog
TaoSecurity Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Recent Commits to openclaw:main
Recent Commits to openclaw:main
博客园 - 三生石上(FineUI控件)
C
CXSECURITY Database RSS Feed - CXSecurity.com
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Cloudbric
Cloudbric
C
Cybersecurity and Infrastructure Security Agency CISA
Project Zero
Project Zero
C
Check Point Blog
S
Security Affairs

博客园 - 生活即技术

好久不更新了,忙的惭愧哦,思考一个应用 利用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