liuyinconn.cs
上传用户:woolgirl
上传日期:2020-04-18
资源大小:243k
文件大小:3k
- using System;
- using System.Data;
- using System.Data.OleDb;//ACCESS
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.SessionState;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- /// <summary>
- /// liuyinconn 的摘要说明
- /// string EnPasdStr = "admin";
- /// string SHA1 = FormsAuthentication.HashPasswordForStoringInConfigFile(EnPasdStr, "SHA1");
- /// string MD5 = FormsAuthentication.HashPasswordForStoringInConfigFile(EnPasdStr, "MD5");
- /// </summary>
- public class liuyinconn
- {
- public static OleDbConnection connstr()
- {
- // string IsSqlDataBase = "0";
- // if (IsSqlDataBase == "0")
- //{
- return new OleDbConnection("Provider=Microsoft.JET.OLEDB.4.0;Data Source=" + System.Web.HttpContext.Current.Server.MapPath("../liuyin_data/data.mdb") + ";");
- // }
- // else if (IsSqlDataBase == "1")
- // {
- // return new SqlConnection("server= (local); database=pubs; uid=sa; pwd=sa");
- //}
- }
- public string PoweredByTitle()
- {
- //网站主题
- string PoweredByTitle = "";
- PoweredByTitle += "印像新闻系统";
- return PoweredByTitle;
- }
- public string PoweredBy()
- {
- //版权信息
- string Powered = "";
- Powered += "n<!--首页生成时间" + System.DateTime.Now + "-->n";
- Powered += "n<!--n";
- Powered += "╔------------------------------------------------╗n";
- Powered += "┆ 印像新闻系统 VER 1.0c ┆n";
- Powered += "┆ ┆n";
- Powered += "┆ 网站信息: 印像新闻系统ASP.NET ┆n";
- Powered += "┆ ┆n";
- Powered += "┆ 美工设计:留印 , www.115000.com.cn ┆n";
- Powered += "┆ 程序设计:留印 , www.115000.com.cn ┆n";
- Powered += "┆ QQ:14339095 QQ群:4052669 ┆n";
- Powered += "┆ ┆n";
- Powered += "╚------------------------------------------------╝n";
- Powered += "-->n";
- return Powered;
- }
- public static bool IsNum(string Str)
- // 检查字符串是否全为数字
- {
- bool blResult = true;
- if (Str == null)
- blResult = false;
- else
- {
- foreach (char Char in Str)
- {
- if (!Char.IsNumber(Char))
- {
- blResult = false;
- break;
- }
- }
- if (blResult)
- if (int.Parse(Str) == 0)
- blResult = false;
- }
- return blResult;
- }
- }