delphi中的部分代码:
function TTalk.Init(bAddr: SYSINT; const strHostIP, strLocalIP, strUser,
strPass: WideString): WideString;
begin
//CoInitialize(nil); 加上也无效
MyCom := TEterm.create;
try
Result := MyCom.Init((bAddr = 1), strHostIP, strLocalIP, strUser, strPass);
except
Result := 'Error Create';
end;
end;
function TTalk.Get_Session: SYSINT;
begin
if Assigned(MyCom) then
Result := MyCom.Session
else
Result := 0;
end;
C#中调用:
ITalk MyEterm=new TalkClass();
MessageBox.Show(MyEterm.Session.ToString());
string Tmp=MyEterm.Init(0,"10.6.168.108","10.143.66.2","cqky10","b");//出错了
MessageBox.Show(Tmp);
MessageBox.Show(MyEterm.GetResult("da",1,1));不知道啥子原因啊?请高手指教
function TTalk.Init(bAddr: SYSINT; const strHostIP, strLocalIP, strUser,
strPass: WideString): WideString;
begin
//CoInitialize(nil); 加上也无效
MyCom := TEterm.create;
try
Result := MyCom.Init((bAddr = 1), strHostIP, strLocalIP, strUser, strPass);
except
Result := 'Error Create';
end;
end;
function TTalk.Get_Session: SYSINT;
begin
if Assigned(MyCom) then
Result := MyCom.Session
else
Result := 0;
end;
C#中调用:
ITalk MyEterm=new TalkClass();
MessageBox.Show(MyEterm.Session.ToString());
string Tmp=MyEterm.Init(0,"10.6.168.108","10.143.66.2","cqky10","b");//出错了
MessageBox.Show(Tmp);
MessageBox.Show(MyEterm.GetResult("da",1,1));不知道啥子原因啊?请高手指教
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货