[C#]在C#中如何进行COM+远程调用?(300分)

  • 主题发起人 主题发起人 yu_ting
  • 开始时间 开始时间
Y

yu_ting

Unregistered / Unconfirmed
GUEST, unregistred user!
经测试,已经实现本地COM+过程调用。但如何调用远程主机的COM+过程呢?
 
Com+ ? 为啥不是web service. (帮你顶)
 
web service是通过Http进行连接的,但我现在需要使用tcp连接。如果解决不了那我就只能使用System.Net.Socket.Tcp自己写连接代码了。
 
using System;

using busSalBeyond;

using System.Data ;

using System.Data.OleDb ;

using System.EnterpriseServices ;

namespace ERPGM
{
[ Transaction(TransactionOption.Required) ]
// [assembly: ApplicationActivation(ActivationOption.Library )]

// public class SalClass:ServicedComponent
public class SalClass
{

public SalClass()
{
}
[AutoComplete]
public static DataSet PtnCredit(string StrCondition {
DataSet ds = new DataSet();

ADODB.Recordset Rs=new ADODB.RecordsetClass ();

OleDbDataAdapter custDA = new OleDbDataAdapter();

try
{
busSalBeyond.clsbusSalBeyondClass BusSal=new clsbusSalBeyondClass();


Rs= BusSal.Query(StrCondition,"","","","","","","","","","","","","","","");

// ContextUtil.SetComplete();


custDA.Fill(ds, Rs, "Result");


return ds;

}
catch(Exception e)
{
// ContextUtil.SetAbort ();

throw new Exception (e.Message );

}

}


}
 
多人接受答案了。
 
后退
顶部