判断地址url是以http://开头的
2013-07-30 14:48
274 查看
#region 方法一 判断网址输入格式
if (txtUrl.Text .Length >=7 && txtUrl.Text.Substring(0, 7) == "http://")
{
labUrl.Visible = false ;
}
else
{
labUrl.Visible = true;
labUrl.Text = "格式为:http://...";
}
if (txtUrlForLogo.Text .Length >=7 && txtUrlForLogo.Text.Substring(0, 7) == "http://")
{
labUrlLogo.Visible = false;
}
else
{
labUrlLogo.Visible = true;
labUrlLogo.Text = "格式为:http://...";
}
#endregion
#region 方法二 判断网址输入格式
if (txtUrl.Text.StartsWith("http://"))// .Substring (0,7) != "http://")
{
labUrl.Visible = false;
}
else
{
labUrl.Visible = true;
labUrl.Text = "格式为:http://...";
}
if (txtUrlForLogo.Text.StartsWith("http://"))
{
labUrlLogo.Visible = false;
}
else
{
labUrlLogo.Visible = true;
labUrlLogo.Text = "格式为:http://...";
}
#endregion
if (txtUrl.Text .Length >=7 && txtUrl.Text.Substring(0, 7) == "http://")
{
labUrl.Visible = false ;
}
else
{
labUrl.Visible = true;
labUrl.Text = "格式为:http://...";
}
if (txtUrlForLogo.Text .Length >=7 && txtUrlForLogo.Text.Substring(0, 7) == "http://")
{
labUrlLogo.Visible = false;
}
else
{
labUrlLogo.Visible = true;
labUrlLogo.Text = "格式为:http://...";
}
#endregion
#region 方法二 判断网址输入格式
if (txtUrl.Text.StartsWith("http://"))// .Substring (0,7) != "http://")
{
labUrl.Visible = false;
}
else
{
labUrl.Visible = true;
labUrl.Text = "格式为:http://...";
}
if (txtUrlForLogo.Text.StartsWith("http://"))
{
labUrlLogo.Visible = false;
}
else
{
labUrlLogo.Visible = true;
labUrlLogo.Text = "格式为:http://...";
}
#endregion
相关文章推荐
- 判断是不是以http:// ftp://和https:// 开头的URL
- 从一串字符串中匹配URL地址 正则 (可以没有http或https开头)
- 判断网站地址是否是http开头
- 从一串字符串中匹配URL地址 正则 (可以没有http或https开头)
- 正则表达式判断并取得string里面的URL地址
- 根据url读取图片,直接压缩写到zip流【含判断url地址是否存在】
- Url地址重写,利用HttpHander手工编译页面并按需生成静态HTML文件
- HttpURLConnection 协议 -包含代理判断
- 判断URL的HTTP状态
- 验证url是否为图片地址,判断
- Java/Android中URL地址合法性的判断
- js判断用户来路url(使用http header referer)
- 正则表达式判断并取得string里面的URL地址
- jquery 判断值是否是url地址
- PHP $_SERVER['HTTP_REFERER'] 获取前一页面的 URL 地址
- IP地址分类/IP地址10开头和172开头和192开头的区别/判断是否同一网段(A、B、C三类地址)
- 读取出来的图片地址转换成http开头的格式
- 关于wamp下http://localhost地址The requested URL / was not found on this server.问题解决过程分享
- http地址自动检测并添加URL链接
- 前端笔试题笔记:拍扁多维数组、提取URL中的参数变成对象、string的trim()函数、判断Email地址、16进制颜色转rgb