zoukankan      html  css  js  c++  java
  • 判断网址输入格式以http://开头的

     #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
  • 相关阅读:
    B树
    23查找树和红黑树
    红黑树---满足红黑性质的二叉查找树
    AVL树---平衡的二叉查找树
    二叉查找树
    Ping程序
    ICMP:Internet控制报文协议
    Unix&Linux大学教程目录
    Linux文件系统
    git简介
  • 原文地址:https://www.cnblogs.com/johnwang/p/3225160.html
Copyright © 2011-2022 走看看