EndpointAddress _endpoint = new EndpointAddress("net.tcp://" + szWord_Operation_Ip + "/CalcService");
var channel = new ChannelFactory<Process_Word_Document.ICalcService>(_binding, _endpoint);
var _client = channel.CreateChannel();
_client.Update_Document_Properties(szFilePath);
OR
EndpointAddress _endpoint = new EndpointAddress("net.tcp://" + szWord_Operation_Ip + "/CalcService");
using (Process_Word_Document.CalcServiceClient _client = new Process_Word_Document.CalcServiceClient(_binding, _endpoint))
_client.Update_Document_Properties(szFilePath);
服务......
[ServiceContract]
public interface ICalcService
{
[OperationContract]
Boolean Process_Word_Document(string szFilePath);
}
public class CalcService : ICalcService
{
public bool Process_Word_Document(string szFilePath)
{
//.....Code
}
}
我只是想知道这些调用方法之间的区别 哪一个更好&amp;这将给我更好的表现。