using MSXML2;
public bool InterfaceEnble()
{
string url = "http://localhost:81/WebServiceLogin.asmx";
XMLHTTP http = new XMLHTTP();
try
{
http.open("GET ", url, false, null, null);
http.send(null);
int iStatus = http.status;
//如果状态不为200,就是不能调用此接口
if (iStatus == )
return true;
}
catch (Exception ex)
{
MessageBox.Show("接口调用失败," + ex);
}
return false;
}
判断接口是否可用
手机扫一扫
移动阅读更方便
你可能感兴趣的文章