⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 check.cs

📁 这是一个图书馆管理用的简化系统
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;

namespace BMS
{
    class Check
    {
        public static bool index(int[] m, int k)
        {
            if (m != null)
            {
                for (int i = 0; i < m.Length; i++)
                {
                    if (m[i] == k)
                    {
                        return true;
                    }
                }
            }
            return false;
        }

        public static bool abc123(System.Windows.Forms.KeyPressEventArgs e)
        {
            if (e.KeyChar >= '!' && e.KeyChar <= '}')
            {
                if ("1234567890_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".IndexOf(e.KeyChar) < 0)
                {
                    return false;
                }
                return true;
            }
            return true;
        }
        public static bool num(System.Windows.Forms.TextBox tb,System.Windows.Forms.KeyPressEventArgs e)
        {
            if (e.KeyChar >= '!' && e.KeyChar <= '}')
            {
                if ("1234567890".IndexOf(e.KeyChar) < 0)
                {
                    if (e.KeyChar == '.' && tb.Text.IndexOf(".") < 0)
                    {
                        return true;
                    }
                    return false;
                }
            }
            return true;

        }
        public static bool Integer(System.Windows.Forms.KeyPressEventArgs e)
        {
            if (e.KeyChar >= '!' && e.KeyChar <= '}')
            {
                if ("1234567890".IndexOf(e.KeyChar) < 0)
                {
                    return false;
                }
                return true;
            }
            return true;

        }
        public static bool safe(System.Windows.Forms.KeyPressEventArgs e)
        {
            if (e.KeyChar >= '!' && e.KeyChar <= '}')
            {
                if ("'<=>".IndexOf(e.KeyChar) >= 0)
                {
                    return false;
                }
                return true;
            }
            return true;
        }
        public static bool Email(System.Windows.Forms.KeyPressEventArgs e)
        {
            if (e.KeyChar >= '!' && e.KeyChar <= '}')
            {
                if ("1234567890._abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@".IndexOf(e.KeyChar) < 0)
                {
                    return false;
                }
                return true;
            }
            return true;
        }
        public static bool Email(string str)
        {
            if (str.Trim() == "")
            {
                return false;
            }
            int local;
            string str1;
            local = str.IndexOf("@");
            if (local > 0 && (str.Substring(local+1)).IndexOf("@")<0)
            {
                if (str.IndexOf(".") > local)
                {
                    local = str.IndexOf(".");
                    str1 = str.Substring(local+1);
                    local = str1.IndexOf(".");
                    if(local>=0 && str1.Substring(0,local)=="")
                    {
                        return false;
                    }
                    if((local<0||str1.LastIndexOf(".")==local)&&str.LastIndexOf(".")<str.Length-1)
                    {
                        return true;
                    }
                }
            }
            return false;
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -