在系统中用到wcf
比如这样使用:
AppWebServiceReference.AppWebServiceClient client = new AppWebServiceReference.AppWebServiceClient();
//地址今后由数据库获取
client.Endpoint.Address = new EndpointAddress("http://localhost:5002/AppWebService.svc");
BasicHttpBinding binding = (BasicHttpBinding)client.Endpoint.Binding;
这样的地址http://localhost:5002/AppWebService.svc,我要怎么判断是否可用
直接把这几行代码 try catch?
------解决方案--------------------------------------------------------
对就是try...catch...