您的位置:首页 > 其它

使用 WMI 创建 BizTalk 发送句柄

2010-03-08 13:52 302 查看
使用WMI创建 BizTalk 发送句柄。发送适配器的类型为 SQL,使用的主机是BizTalkServerApplication32。

代码如下:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Management;
namespace CreateSendHandler
{
class Program
{
static void Main(string[] args)
{
string AdapterName = "SQL";
string HostName = "BizTalkServerApplication32";
try
{
PutOptions options = new PutOptions();
options.Type = PutType.CreateOnly;
ManagementClass objClass = new ManagementClass("root//MicrosoftBizTalkServer", "MSBTS_SendHandler2", null);
ManagementObject objSendHandler = objClass.CreateInstance();

objSendHandler["AdapterName"] = AdapterName;
objSendHandler["HostName"] = HostName;

objSendHandler.Put(options);
}
catch (Exception ex)
{
Console.WriteLine("Exception: " + ex.Message);
}
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐