MSCL超級工具類(C#),開發人員必備,開發利器

來源:互聯網
上載者:User

標籤:串處理   public   execl   ppa   加密解密   system   類集   sql   程式猿   

MSCL超強工具類庫

是基於C#開發的超強工具類集合,涵蓋了日常B/S或C/S開發的諸多方面,包含上百個常用封裝類(資料庫操作類全面支援Mysql、Access、Oracle、Sqlserver、Sqlite等資料庫,常用字串處理類,記憶體容器類,Session/Cookie/Cache類,Config設定檔協助類,資料類型轉換類,進位轉換類,時間日期協助類,資料加密解密類,檔案/目錄操作類,檔案下載類,FTP操作類,圖片上傳/下載類,圖片常用處理類-翻轉,模糊,浮水印,縮減等,Json輔助類,Log日誌類,Http封裝類,Email郵件封裝類,NOPI操作類-無依賴Office組件實現execl匯入匯出利器,Execl/CSV操作類,Until常用工具類,資料分頁類,遠程採集類,JS封裝類,Reg正則驗證類,Request請求類,隨機數產生類,序列化還原序列化封裝類,XML操作類,ZIP壓縮和解壓類等等等。。。此處省略一萬字),即拿即用,封裝類附帶調用樣本和參數注釋,全傻瓜式調用,簡單易用。擁有此超強工具類,能大大的提高C#開發人員的效率和代碼品質,真正做到“工具在手,一有盡有”,讓苦逼的廣大程式猿朋友,早日脫離苦海,暢遊在代碼的世界裡 ^_^,如需購買MSCL超級工具類庫源碼,請掃碼部落格右側二維碼購買

using System;using System.Collections.Generic;using System.Text;using System.IO;using System.Reflection;using System.Data;using System.Data.SqlClient;using System.Web; namespace MSCL{    /// <summary>    /// 日誌協助類    /// </summary>    public class LogHelper    {         /// <summary>        /// 記錄錯誤資訊        /// </summary>        /// <param name="ex">錯誤</param>        public static void ErrorLog(Exception ex)        {            string dir = Path() + @"/Log/" + DateTime.Now.ToString("yyyy-MM") + "/";            string fileName = "log_" + DateTime.Now.ToString("dd") + ".txt";            string path = dir + fileName;            StreamWriter sw = null;            try            {                Directory.CreateDirectory(dir);                sw = new StreamWriter(path, true);                sw.WriteLine(string.Format("-------------{0}--------------", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ffff")));                sw.WriteLine(ex.ToString());                sw.WriteLine();                sw.Flush();            }            catch { }            finally            {                if (sw != null)                {                    sw.Close();                    sw = null;                }            }        }         /// <summary>        /// 記錄錯誤資訊        /// </summary>        /// <param name="str">錯誤資訊</param>        public static void ErrorLog(string str)        {            string dir = Path() + @"/Log/" + DateTime.Now.ToString("yyyy-MM") + "/";            string fileName = "log_custome_" + DateTime.Now.ToString("dd") + ".txt";            string path = dir + fileName;            StreamWriter sw = null;            try            {                Directory.CreateDirectory(dir);                sw = new StreamWriter(path, true);                sw.WriteLine(string.Format("-------------{0}--------------", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ffff")));                sw.WriteLine(str);                sw.WriteLine();                sw.Flush();            }            catch { }            finally            {                if (sw != null)                {                    sw.Close();                    sw = null;                }            }        }         /// <summary>        /// 拿到項目所在目錄        /// </summary>        /// <returns></returns>        private static string Path()        {            string path = HttpContext.Current.Server.MapPath("~/");            return path;        }    }}

MSCL超級工具類(C#),開發人員必備,開發利器

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.