liuyinconn.cs
上传用户:woolgirl
上传日期:2020-04-18
资源大小:243k
文件大小:3k
源码类别:

SCSI/ASPI

开发平台:

Others

  1. using System;
  2. using System.Data;
  3. using System.Data.OleDb;//ACCESS
  4. using System.Configuration;
  5. using System.Collections;
  6. using System.Web;
  7. using System.Web.Security;
  8. using System.Web.SessionState;
  9. using System.Web.UI;
  10. using System.Web.UI.WebControls;
  11. using System.Web.UI.WebControls.WebParts;
  12. using System.Web.UI.HtmlControls;
  13. /// <summary>
  14. /// liuyinconn 的摘要说明
  15. /// string EnPasdStr = "admin";
  16. /// string SHA1 = FormsAuthentication.HashPasswordForStoringInConfigFile(EnPasdStr, "SHA1");
  17. /// string MD5 = FormsAuthentication.HashPasswordForStoringInConfigFile(EnPasdStr, "MD5");
  18. /// </summary>
  19. public class liuyinconn
  20. {
  21.     public static OleDbConnection connstr()
  22.     {
  23.         // string IsSqlDataBase = "0";
  24.         // if (IsSqlDataBase == "0")
  25.         //{
  26.         return new OleDbConnection("Provider=Microsoft.JET.OLEDB.4.0;Data Source=" + System.Web.HttpContext.Current.Server.MapPath("../liuyin_data/data.mdb") + ";");
  27.         // }
  28.         // else if (IsSqlDataBase == "1")
  29.         // {
  30.         // return new SqlConnection("server= (local); database=pubs; uid=sa; pwd=sa");
  31.         //}
  32.     }
  33.     public string PoweredByTitle()
  34.     {
  35.         //网站主题
  36.         string PoweredByTitle = "";
  37.         PoweredByTitle += "印像新闻系统";
  38.         return PoweredByTitle;
  39.     }
  40.     public string PoweredBy()
  41.     {
  42.         //版权信息
  43.         string Powered = "";
  44.         Powered += "n<!--首页生成时间" + System.DateTime.Now + "-->n";
  45.         Powered += "n<!--n";
  46.         Powered += "╔------------------------------------------------╗n";
  47.         Powered += "┆              印像新闻系统 VER 1.0c             ┆n";
  48.         Powered += "┆                                                ┆n";
  49.         Powered += "┆    网站信息: 印像新闻系统ASP.NET               ┆n";
  50.         Powered += "┆                                                ┆n";
  51.         Powered += "┆    美工设计:留印 , www.115000.com.cn          ┆n";
  52.         Powered += "┆    程序设计:留印 , www.115000.com.cn          ┆n";
  53.         Powered += "┆              QQ:14339095  QQ群:4052669       ┆n";
  54.         Powered += "┆                                                ┆n";
  55.         Powered += "╚------------------------------------------------╝n";
  56.         Powered += "-->n";
  57.         return Powered;
  58.     }
  59.     public static bool IsNum(string Str)
  60.     // 检查字符串是否全为数字
  61.     {
  62.         bool blResult = true;
  63.         if (Str == null)
  64.             blResult = false;
  65.         else
  66.         {
  67.             foreach (char Char in Str)
  68.             {
  69.                 if (!Char.IsNumber(Char))
  70.                 {
  71.                     blResult = false;
  72.                     break;
  73.                 }
  74.             }
  75.             if (blResult)
  76.                 if (int.Parse(Str) == 0)
  77.                     blResult = false;
  78.         }
  79.         return blResult;
  80.     }
  81. }