using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Tools 的摘要说明
/// </summary>
public class Tools
{
	/// <summary>
	/// 验证非法字符
	/// </summary>
	/// <param name="str"></param>
	/// <returns></returns>
	public static bool validate(string str)
	{
		string strobj;
		bool ss = false;
		for (int i = 0; i < str.Length; i++)
		{
			strobj = str.Substring(i, 1);
			if (strobj == "%" || strobj == "&" || strobj == "'" || strobj == "|" || strobj == "<" || strobj == ">")
			{
				ss = true;
				break;
			}
		}
		return ss;
	}

	/// <summary>
	/// 数据库连接字符串
	/// </summary>
	public readonly static string strConn = System.Configuration.ConfigurationManager.AppSettings["strcon"];

	#region 获取No(年月日加时间)
	/// <summary>
	/// 获取No(年月日加时间)
	/// </summary>
	/// <returns></returns>
	public static string GetProxySheetNo()
	{
		string getNo = "";
		string getStrTime = DateTime.Now.ToLongTimeString();
		string getStrDate = DateTime.Now.ToShortDateString();
		string words = getStrDate + getStrTime;

		string[] split = words.Split(new char[] { '-', ':' });

		foreach (string s in split)
		{
			getNo += s;
		}
		return getNo;
	}
	#endregion
}
