curriculum_design/Data/Head.cs

(开头部分) 12KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/****************************************
 *				全局函数类				*
 *			Made by MeiZhaoRui			*
 *			2014年05月01日 更新			*
 ***************************************/

using System;
using System.Collections;
using System.Data;
using System.IO;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;

namespace curriculum_design
{
	class Global
	{
		public const string UnAcceptChars = "^+-*`=<>~!#$%^&(){}[]|;\':\",./?\\ ";
		public const string zeroFormatStr = "0.00";
		public const string Man = "M", Woman = "W";
		public static bool ShowCloseOption { get; set; }/*窗口应用关闭时是否有提示*/
		private Global() { }
		/// <summary>
		/// 判断是否存在于UnAcceptChars中的出现的非法字符串
		/// </summary>
		public enum CheckState { Empty, Forbidden, Correct };
		/// <summary>
		/// 判断输入的字符是否合法
		/// </summary>
		/// <param name="str">待检测的字符串</param>
		/// <param name="CheckUserName">因为用户名首字母不能为数字</param>
		/// <returns></returns>
		public static CheckState CheckStr(string str, bool CheckUserName = false)
		{
			if (str.Length == 0)
				return CheckState.Empty;
			if (CheckUserName && (str[0] >= '0' && str[0] <= '9'))
				return CheckState.Forbidden;
			else
				foreach (char i in str)
				{
					if (UnAcceptChars.IndexOf(i) != -1)
						return CheckState.Forbidden;
				}
			return CheckState.Correct;
		}
		/// <summary>
		/// 规范金钱的输入格式
		/// </summary>
		/// <param name="sender">TextBox 控件</param>
		/// <param name="e">按钮按下事件</param>
		public static void CheckMoney(ref object sender, ref KeyPressEventArgs e)
		{
			if (e.KeyChar == '.' && ((TextBox)sender).Text.IndexOf(".") >= 0)
			{
				e.Handled = true; return;
后面还有 352 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。