当前位置: 移动技术网 > IT编程>开发语言>.net > asp.net(c#)判断远程图片是否存在

asp.net(c#)判断远程图片是否存在

2018年04月20日  | 移动技术网IT编程  | 我要评论

租赁合同范本,别动我的抽屉吻戏,动物交配过程

复制代码 代码如下:

private int geturlerror(string curl)
{
int num = 200;
if(this.method==1)
{
httpwebrequest request=(httpwebrequest) webrequest.create(new uri(curl));
servicepointmanager.expect100continue=false;
try
{
((httpwebresponse)request.getresponse()).close();
}
catch(webexception exception)
{
if(exception.status != webexceptionstatus.protocolerror)
{
return num;
}
if(exception.message.indexof( "500 ")>0)
{
return 500;
}
if(exception.message.indexof( "401 ")>0)
{
return 401;
}
if(exception.message.indexof("404")>0)
{
num=404;
}
}
return num;
}
}

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网