字元串幫助類

来源:http://www.cnblogs.com/shouce/archive/2016/02/23/5208697.html
-Advertisement-
Play Games

#region 格式化 /// <summary> /// 格式化 /// </summary> /// <param name="sInput">本身字元串</param> /// <param name="args"></param> /// <returns></returns> public


#region 格式化
        /// <summary>
        /// 格式化
        /// </summary>
        /// <param name="sInput">本身字元串</param>
        /// <param name="args"></param>
        /// <returns></returns>       
        public static string format(this string sInput, params object[] args)
        {
            return String.Format(sInput, args);
        }
        #endregion

        #region 倒轉字元串
        /// <summary>
        /// 倒轉字元串
        /// </summary>
        public static string Reverse(this string sInput)
        {
            char[] chars = sInput.ToCharArray();
            Array.Reverse(chars);
            return new String(chars);
        }
        #endregion

        #region 判斷是否為email
        /// <summary>
        /// 判斷是否為email
        /// </summary>
        /// <param name="email"></param>
        /// <returns></returns>
        public static bool IsEmail(string email)
        {
            if (string.IsNullOrWhiteSpace(email))
            {
                return false;
            }
            string pattern = "\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";
            return Regex.IsMatch(email, pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
        }
        #endregion

        #region 判斷是否為手機號
        /// <summary>
        /// 判斷是否為手機號
        /// </summary>
        /// <param name="mobile"></param>
        /// <returns></returns>
        public static bool IsMobile(string mobile)
        {
            if (string.IsNullOrWhiteSpace(mobile))
            {
                return false;
            }
            string pattern = "^(13|15|18)[0-9]{9}$";
            return Regex.IsMatch(mobile, pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
        }
        #endregion

        #region 判斷是否為電話
        /// <summary>
        /// 判斷是否為電話
        /// </summary>
        /// <param name="phone">0755-45784678-85</param>
        /// <returns></returns>
        public static bool IsPhone(string phone)
        {
            if (string.IsNullOrWhiteSpace(phone))
            {
                return false;
            }
            string pattern = "^(([0-9]{3,4})|[0-9]{3,4}-)?[0-9]{7,8}(-[0-9]{2,4})?$";
            return Regex.IsMatch(phone, pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
        }
        #endregion

        #region 判斷是否為郵編
        /// <summary>
        /// 判斷是否為郵編
        /// </summary>
        /// <param name="phone">415118</param>
        /// <returns></returns>
        public static bool IsPostCode(string postcode)
        {
            if (string.IsNullOrWhiteSpace(postcode))
            {
                return false;
            }
            string pattern = "^[0-9]{6}$";
            return Regex.IsMatch(postcode, pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
        }
        #endregion

        #region 是否有效的姓名
        /// <summary>
        /// 是否有效的姓名
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public static bool IsValidName(string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                return false;
            }
            string pattern = "^(([\u4e00-\u9fa5]{2,5})|([a-zA-Z]{1,10}[a-zA-Z. ]{1,20}[a-zA-Z]{1,10}))$";
            return Regex.IsMatch(name, pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
        }
        #endregion

        #region 是否有效的中文名
        /// <summary>
        /// 是否有效的中文名
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public static bool IsValidChineseName(string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                return false;
            }
            string pattern = "^[\u4e00-\u9fa5]{2,5}$";
            return Regex.IsMatch(name, pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
        }
        #endregion

        #region 是否為正確的QQ號
        /// <summary>
        /// 是否為正確的QQ號
        /// </summary>
        /// <param name="qq"></param>
        /// <returns></returns>
        public static bool IsQQ(string qq)
        {
            if (string.IsNullOrWhiteSpace(qq))
            {
                return false;
            }
            string pattern = "^[1-9][0-9]{4,}$";
            return Regex.IsMatch(qq, pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
        }
        #endregion

        #region 是否數字
        /// <summary>
        /// 是否數字
        /// </summary>
        /// <param name="sNumeric"></param>
        /// <returns></returns>
        public static bool IsNumeric(string sNumeric)
        {
            return (new Regex("^[\\+\\-]?[0-9]*\\.?[0-9]+$")).IsMatch(sNumeric);
        }
        #endregion

        #region 是否整數
        /// <summary>
        /// 是否整數
        /// </summary>
        /// <param name="sNumeric"></param>
        /// <returns></returns>
        public static bool IsInt(string intString)
        {
            return (new Regex("^[\\+\\-]?[0-9]+$")).IsMatch(intString);
        }
        #endregion

        #region 是否為正整數
        /// <summary>
        /// 是否為正整數
        /// </summary>
        /// <param name="sNumeric"></param>
        /// <returns></returns>
        public static bool IsPosInt(string intString)
        {
            return (new Regex("^[0-9]*[1-9][0-9]*$")).IsMatch(intString);
        }
        #endregion

        #region 自定義截取字元串
        /// <summary>
        /// 自定義截取字元串
        /// </summary>
        /// <param name="str">待截取的字元串</param>
        /// <param name="len">長度</param>
        /// <param name="hasDots">是否帶"..."</param>
        /// <returns></returns>
        public static string SubString(string str, int len, bool hasDots)
        {
            if (string.IsNullOrWhiteSpace(str)) return string.Empty;

            string dots = string.Empty;

            if (len >= str.Length)
                return str;

            if (hasDots)
                dots = "...";

            return str.Substring(0, len) + dots;
        }
        #endregion

        #region 取得客戶端IP地址
        //獲取客戶端IP
        public static string GetClientIP()
        {
            string result = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (null == result || result == String.Empty)
            {
                result = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
            }

            if (null == result || result == String.Empty)
            {
                result = HttpContext.Current.Request.UserHostAddress;
            }

            if (null == result || result == String.Empty)
            {
                return "0.0.0.0";
            }
            if (result.Equals("::1"))
            {
                return "127.0.0.1";
            }
            return result;
        }

        /// <summary>
        /// 將最後一位數字換為*
        /// </summary>
        /// <param name="ip">輸入的ip</param>
        /// <returns></returns>
        public static string FilterLastNum(string ip)
        {
            string result = string.Empty;

            string[] s = ip.Split('.');

            for (int i = 0; i < s.Length - 1; i++)
            {
                result += s[i] + ".";
            }
            result += "*";

            return result;
        }
        #endregion

        #region 將ID字元串轉化為int數組

        /// <summary>
        /// 將ID字元串轉化為int數組,預設使用空格和逗號分割
        /// </summary>
        /// <param name="idString"></param>
        /// <param name="splitChars"> </param>
        /// <returns></returns>
        public static List<int> ConvertFromIdString(string idString,params char[] splitChars)
        {
            if (!string.IsNullOrWhiteSpace(idString))
            {
                List<string> strings;
                if(splitChars == null||splitChars.Length == 0)
                {
                    strings = idString.Split(new []{' ', ','}, StringSplitOptions.RemoveEmptyEntries).ToList();
                }
                else
                {
                    strings = idString.Split(splitChars, StringSplitOptions.RemoveEmptyEntries).ToList();
                }

                return strings.ConvertAll(DataTypeHelper.GetInt32);

            }
            return new List<int>();
        }
        #endregion

        #region 獲取合法的主鍵字元串
        /// <summary>
        /// 獲取合法的主鍵字元串,比如 1,3,6,7
        /// </summary>
        /// <param name="strKeys"></param>
        /// <returns></returns>
        public static String GetLegalKeyStr(String strKeys)
        {
            if (String.IsNullOrWhiteSpace(strKeys))
            {
                return String.Empty;
            }
            List<String> list = new List<String>();
            foreach (String key in strKeys.Split(',', ' '))
            {
                if (Regex.IsMatch(key, @"^[0-9]+$", RegexOptions.Compiled))
                {
                    list.Add(key);
                }
            }
            list.Sort();
            return String.Join(",", list.Distinct().ToArray());
        }
        #endregion

        #region 獲取合法的字典字元串
        /// <summary>
        /// 獲取合法的字典字元串,比如 a,b,d,e
        /// </summary>
        /// <param name="strKeys"></param>
        /// <returns></returns>
        public static string GetLegalDictKey(string strKeys)
        {
            if (string.IsNullOrWhiteSpace(strKeys))
            {
                return string.Empty;
            }
            strKeys = strKeys.ToLower();
            strKeys = Regex.Replace(strKeys, "[^,a-z0-9_]", string.Empty, RegexOptions.Compiled);
            strKeys = Regex.Replace(strKeys, "[,]{2,}", ",", RegexOptions.Compiled);
            strKeys = strKeys.Trim(',');
            return strKeys;
        }
        #endregion

        #region 獲取合法的主鍵字元串
        /// <summary>
        /// 獲取前後有,的主鍵字元串,比如 ,1,3,6,7,
        /// </summary>
        /// <param name="strKeys"></param>
        /// <returns></returns>
        public static string GetWrapedKeyStr(string strKeys)
        {
            return strKeys = string.Format(",{0},", GetLegalKeyStr(strKeys));
        }
        #endregion

        #region 獲取合法的字典字元串
        /// <summary>
        /// 獲取有'的字典字元串,比如 'a','b','c','d'
        /// </summary>
        /// <param name="strKeys"></param>
        /// <returns></returns>
        public static string GetWrapedDictKey(string strKeys)
        {
            strKeys = GetLegalDictKey(strKeys);
            if (string.IsNullOrEmpty(strKeys))
            {
                return string.Empty;
            }
            strKeys = strKeys.Replace(",", "','");
            return strKeys = string.Format("'{0}'", strKeys);
        }
        #endregion

        #region 轉換文件大小
        /// <summary>
        /// 轉換文件大小
        /// </summary>
        /// <param name="fileSize"></param>
        /// <returns></returns>
        public static String FormatFileSize(long fileSize)
        {
            String fileSizeString = "";
            if (fileSize < 1024)
            {
                fileSizeString = fileSize + " B";
            }
            else if (fileSize < 1024 * 1024)
            {
                fileSizeString = String.Format("{0:F2}", (double)fileSize / 1024) + " K";
            }
            else if (fileSize < 1024 * 1024 * 1024)
            {
                fileSizeString = String.Format("{0:F2}", (double)fileSize / (1024 * 1024)) + " M";
            }
            else
            {
                fileSizeString = String.Format("{0:F2}", (double)fileSize / (1024 * 1024 * 1024)) + " G";
            }
            return fileSizeString;
        }
        #endregion

        #region 通過正則匹配獲取值
        /// <summary>
        /// 通過正則匹配獲取值
        /// </summary>
        /// <param name="input"></param>
        /// <param name="pattern"></param>
        /// <returns></returns>
        public static GroupCollection GetPatternValue(string input, string pattern)
        {
            if (string.IsNullOrWhiteSpace(input))
            {
                return null;
            }
            Match match = Regex.Match(input, pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
            if (match.Success && match.Groups.Count > 0)
            {
                return match.Groups;
            }
            return null;
        }

        /// <summary>
        /// 通過正則匹配獲取值
        /// </summary>
        /// <param name="input"></param>
        /// <param name="pattern"></param>
        /// <returns></returns>
        public static MatchCollection GetPatternValues(string input, string pattern)
        {
            if (string.IsNullOrWhiteSpace(input))
            {
                return null;
            }
            MatchCollection match = Regex.Matches(input, pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
            return match;
        }
        #endregion

        #region 合併路徑
        /// <summary>
        /// 合併路徑
        /// </summary>
        /// <param name="separator"></param>
        /// <param name="path1"></param>
        /// <param name="path2"></param>
        /// <returns></returns>
        public static string CombinPath(char separator, string path1, string path2)
        {
            if (string.IsNullOrWhiteSpace(path1) || string.IsNullOrWhiteSpace(path2))
            {
                return path1 ?? path2;
            }

            bool b1 = path1[path1.Length - 1] == separator;
            bool b2 = path2[0] == separator;

            if (b1 && b2)
            {
                return path1 + path2.TrimStart(separator);
            }

            if (b1 || b2)
            {
                return path1 + path2;
            }

            return string.Concat(path1, separator, path2);
        }

        /// <summary>
        /// 合併路徑
        /// </summary>
        /// <param name="separator"></param>
        /// <param name="paths"></param>
        /// <returns></returns>
        public static string CombinPath(char separator, params string[] paths)
        {
            if (paths == null || paths.Length == 0)
            {
                return string.Empty;
            }
            else if (paths.Length == 1)
            {
                return paths[0];
            }
            System.Text.StringBuilder sb = new System.Text.StringBuilder(paths[0]);

            for (int i = 1; i < paths.Length; ++i)
            {
                string path = paths[i];
                if (string.IsNullOrEmpty(path))
                {
                    continue;
                }

                bool b1 = sb[sb.Length - 1] == separator;
                bool b2 = path[0] == separator;

                if (b1 && b2)
                {
                    sb.Append(path.TrimStart(separator));
                }
                else if (b1 || b2)
                {
                    sb.Append(path);
                }
                else
                {
                    sb.Append(separator);
                    sb.Append(path);
                }
            }

            return sb.ToString();
        }
        #endregion

        #region 計算頁數
        /// <summary>
        /// 計算頁數
        /// </summary>
        /// <param name="totalRecordCount"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public static int GetPageCount(int totalRecordCount, int pageSize)
        {
            return Convert.ToInt32(Math.Ceiling((double)totalRecordCount / pageSize));
        }
        #endregion

        #region 版本比較
        /// <summary>
        /// 版本比較
        /// </summary>
        /// <param name="version1"></param>
        /// <param name="version2"></param>
        /// <returns></returns>
        public static int CompareVersion(string version1, string version2)
        {
            version1 = Regex.Replace(version1, "[^0-9.]", "", RegexOptions.Compiled);
            version2 = Regex.Replace(version2, "[^0-9.]", "", RegexOptions.Compiled);

            if (string.IsNullOrEmpty(version1) || string.IsNullOrEmpty(version2))
            {
                return string.Compare(version1, version2);
            }

            Version v1 = new Version(version1);
            Version v2 = new Version(version2);

            return v1.CompareTo(v2);
        }
        #endregion

        #region 將字元串形式的IP轉換位long
        ///<summary>
        /// 將字元串形式的IP轉換位long
        ///</summary>
        ///<param name="ipAddress"></param>
        ///<returns></returns>
        public static long IpToLong(string ipAddress)
        {
            if (string.IsNullOrWhiteSpace(ipAddress)) return 0;

            byte[] ip_bytes = new byte[8];
            string[] strArr = ipAddress.Split(new char[] { '.' });
            if (strArr.Length != 4) return 0;

            for (int i = 0; i < 4; i++)
            {
                byte b = 0;
                if (byte.TryParse(strArr[3 - i], out b))
                {
                    ip_bytes[i] = b;
                }
                else
                {
                    return 0;
                }
            }
            return BitConverter.ToInt64(ip_bytes, 0);
        }
        #endregion

        #region 混淆密碼(如將123456變為1****6)
        /// <summary>
        /// 混淆密碼(如將123456變為1****6)
        /// </summary>
        /// <param name="passwd"></param>
        /// <returns></returns>
        public static string MixPasswd(string passwd)
        {
            if (string.IsNullOrEmpty(passwd)) return string.Empty;

            char[] newPasswd = new char[passwd.Length];

            int mixed = 0;
            int i = 0;
            Random rand = new Random();
            foreach (char ch in passwd)
            {
                if (rand.Next(100) > 55)
                {
                    ++mixed;
                    newPasswd[i++] = '*';
                }
                else
                {
                    newPasswd[i++] = ch;
                }
            }

            i = 0;
            while (mixed < passwd.Length / 2) // 至少一半替換為*
            {
                if (newPasswd[i] != '*')
                {
                    ++mixed;
                    newPasswd[i++] = '*';
                }
            }

            return new string(newPasswd);
        }
        #endregion

        #region 日期

        /// <summary>
        /// 判斷今天是第幾周
        /// </summary>
        /// <param name="date"></param>
        /// <returns></returns>
        public static int WeekNumber(DateTime date)
        {
            string firstDateText = date.Year + "-1-1";
            DateTime firstDay = Convert.ToDateTime(firstDateText);
            int theday;
            switch (firstDay.DayOfWeek)
            {
                case DayOfWeek.Monday:
                    theday = -1;
                    break;
                case DayOfWeek.Tuesday:
                    theday = 0;
                    break;
                case DayOfWeek.Wednesday:
                    theday = 1;
                    break;
                case DayOfWeek.Thursday:
                    theday = 2;
                    break;
                case DayOfWeek.Friday:
                    theday = 3;
                    break;
                case DayOfWeek.Saturday:
                    theday = 4;
                    break;
                default:
                    theday = 5;
                    break;
            }
            int weekNum = (date.DayOfYear + theday) / 7 + 1;
            return weekNum;
        }

        /// <summary>
        /// 年內某周的日期範圍
        /// </summary>
        /// <param name="yearNum"></param>
        /// <param name="weekNum"></param>
        /// <returns></returns>
        public static String WeekRange(int yearNum, int weekNum)
        {
            DateTime firstOfYear = new DateTime(yearNum, 1, 1);
            System.DayOfWeek dayofweek = firstOfYear.DayOfWeek;
            DateTime stand = firstOfYear.AddDays(weekNum * 7);
            DateTime start = default(DateTime);
            DateTime end = default(DateTime);
            switch (dayofweek)
            {
                case DayOfWeek.Monday:
                    start = stand.AddDays(0);
                    end = stand.AddDays(6);
                    break;
                case DayOfWeek.Tuesday:
                    start = stand.AddDays(-1);
                    end = stand.AddDays(5);
                    break;
                case DayOfWeek.Wednesday:
                    start = stand.AddDays(-2);
                    end = stand.AddDays(4);
                    break;
                case DayOfWeek.Thursday:
                    start = stand.AddDays(-3);
                    end = stand.AddDays(3);
                    break;
                case DayOfWeek.Friday:
                    start = stand.AddDays(-4);
                    end = stand.AddDays(2);
                    break;
                case DayOfWeek.Saturday:
                    start = stand.AddDays(-5);
                    end = stand.AddDays(1);
                    break;
                default:
                    start = stand.AddDays(-6);
                    end = stand.AddDays(0);
                    break;
            }
            return start.ToString("yyyy/MM/dd") + " — " + end.ToString("yyyy/MM/dd");
        }

        #endregion

  


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • Spark快速入門 Spark 1.6.0 轉載請註明出處: "http://www.cnblogs.com/BYRans/" 快速入門(Quick Start) 本文簡單介紹了Spark的使用方式。首先介紹Spark的交互界面的API使用,然後介紹如何使用Java、Scala以及Python編寫S
  • 出錯 信息: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)'及 如果忘記了MySQL的root用戶密碼可以如下操作(Linux下):如果 MySQL 正在運行,首先殺之:
  • 在Oracle資料庫中,刪除重覆數據,大都會使用如下方法: delete from tbl a where rowid<>(select max(b.rowid) from tbl b where a.col1=b.col1 and a.col2 = b.col2);
  • 判斷表中是否存在記錄,我們慣常使用的語句是: select COUNT(*) from tableName where conditions 如果只是判斷記錄是否存在,而不需要獲取實際表中的記錄數,網上還有一種推薦做法: if exists (select * from tableName wher
  • SQL Server代理是所有實時資料庫的核心。代理有很多不明顯的用法,因此系統的知識,對於開發人員還是DBA都是有用的。這系列文章會通俗介紹它的很多用法。 在這個系列的前幾篇文章里,你創建配置了SQL Server代理作業。每個作業有一個或更多步驟,如你在前幾篇文章所示,也會包括大量的工作流。在這
  • 最近監控到類似這樣一個慢查詢: select delete_flag,delete_time from D_OrderInfo WHERE ( OrderId is not null and OrderId = N'xxxx') D_OrderInfo表上有一個OrderId的索引,但OrderId
  • 在開發Webapi項目時每寫完一個方法時,是不是需要添加相應的功能說明和測試案例呢?為了更簡單方便的寫說明介面文檔和介面測試HelpPage提供了一個方便的途徑。 她的大致原理是:在編譯時會生成.dll程式集和.xml程式集說明文件,通過xml文件獲取Controller名稱、action名稱、參數
  • C#獲取存儲過程的返回值,這一方法,總是容易忘,今天給貼出來,以方便下次使用 存儲過程: CREATE PROCEDURE [dbo].[Proc_GetInfo] @ywdm varchar(10), @value varchar(20) outputASbegin set @value=Sele
一周排行
    -Advertisement-
    Play Games
  • 示例項目結構 在 Visual Studio 中創建一個 WinForms 應用程式後,項目結構如下所示: MyWinFormsApp/ │ ├───Properties/ │ └───Settings.settings │ ├───bin/ │ ├───Debug/ │ └───Release/ ...
  • [STAThread] 特性用於需要與 COM 組件交互的應用程式,尤其是依賴單線程模型(如 Windows Forms 應用程式)的組件。在 STA 模式下,線程擁有自己的消息迴圈,這對於處理用戶界面和某些 COM 組件是必要的。 [STAThread] static void Main(stri ...
  • 在WinForm中使用全局異常捕獲處理 在WinForm應用程式中,全局異常捕獲是確保程式穩定性的關鍵。通過在Program類的Main方法中設置全局異常處理,可以有效地捕獲並處理未預見的異常,從而避免程式崩潰。 註冊全局異常事件 [STAThread] static void Main() { / ...
  • 前言 給大家推薦一款開源的 Winform 控制項庫,可以幫助我們開發更加美觀、漂亮的 WinForm 界面。 項目介紹 SunnyUI.NET 是一個基於 .NET Framework 4.0+、.NET 6、.NET 7 和 .NET 8 的 WinForm 開源控制項庫,同時也提供了工具類庫、擴展 ...
  • 說明 該文章是屬於OverallAuth2.0系列文章,每周更新一篇該系列文章(從0到1完成系統開發)。 該系統文章,我會儘量說的非常詳細,做到不管新手、老手都能看懂。 說明:OverallAuth2.0 是一個簡單、易懂、功能強大的許可權+可視化流程管理系統。 有興趣的朋友,請關註我吧(*^▽^*) ...
  • 一、下載安裝 1.下載git 必須先下載並安裝git,再TortoiseGit下載安裝 git安裝參考教程:https://blog.csdn.net/mukes/article/details/115693833 2.TortoiseGit下載與安裝 TortoiseGit,Git客戶端,32/6 ...
  • 前言 在項目開發過程中,理解數據結構和演算法如同掌握蓋房子的秘訣。演算法不僅能幫助我們編寫高效、優質的代碼,還能解決項目中遇到的各種難題。 給大家推薦一個支持C#的開源免費、新手友好的數據結構與演算法入門教程:Hello演算法。 項目介紹 《Hello Algo》是一本開源免費、新手友好的數據結構與演算法入門 ...
  • 1.生成單個Proto.bat內容 @rem Copyright 2016, Google Inc. @rem All rights reserved. @rem @rem Redistribution and use in source and binary forms, with or with ...
  • 一:背景 1. 講故事 前段時間有位朋友找到我,說他的窗體程式在客戶這邊出現了卡死,讓我幫忙看下怎麼回事?dump也生成了,既然有dump了那就上 windbg 分析吧。 二:WinDbg 分析 1. 為什麼會卡死 窗體程式的卡死,入口門檻很低,後續往下分析就不一定了,不管怎麼說先用 !clrsta ...
  • 前言 人工智慧時代,人臉識別技術已成為安全驗證、身份識別和用戶交互的關鍵工具。 給大家推薦一款.NET 開源提供了強大的人臉識別 API,工具不僅易於集成,還具備高效處理能力。 本文將介紹一款如何利用這些API,為我們的項目添加智能識別的亮點。 項目介紹 GitHub 上擁有 1.2k 星標的 C# ...