ソースを参照

优化MAC地址格式化方式

yuzhengyang 7 年 前
コミット
73a5b0c9b3

BIN
Fork.Net/.vs/Fork.Net/v15/Server/sqlite3/storage.ide


BIN
Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide


BIN
Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide-shm


BIN
Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide-wal


+ 9 - 9
Fork.Net/Azylee.Utils/Azylee.Core/WindowsUtils/InfoUtils/NetcardInfoTool.cs

@@ -118,11 +118,11 @@ namespace Azylee.Core.WindowsUtils.InfoUtils
         }
         }
 
 
         /// <summary>
         /// <summary>
-        /// 格式化MAC地址(基础款
+        /// 格式化MAC地址(大写、':' 分割
         /// </summary>
         /// </summary>
         /// <param name="s"></param>
         /// <param name="s"></param>
         /// <returns></returns>
         /// <returns></returns>
-        public static string MACFormat(string s)
+        public static string MACFormat(string s, bool isUpper = true)
         {
         {
             StringBuilder sb = new StringBuilder();
             StringBuilder sb = new StringBuilder();
             if (!string.IsNullOrWhiteSpace(s))
             if (!string.IsNullOrWhiteSpace(s))
@@ -130,15 +130,15 @@ namespace Azylee.Core.WindowsUtils.InfoUtils
                 if (s.Length == 12)
                 if (s.Length == 12)
                 {
                 {
                     sb.Append(
                     sb.Append(
-                        $"{s.Substring(0, 2)}:" +
-                        $"{s.Substring(2, 2)}:" +
-                        $"{s.Substring(4, 2)}:" +
-                        $"{s.Substring(6, 2)}:" +
-                        $"{s.Substring(8, 2)}:" +
-                        $"{s.Substring(10, 2)}");
+                         $"{s.Substring(0, 2)}:" +
+                         $"{s.Substring(2, 2)}:" +
+                         $"{s.Substring(4, 2)}:" +
+                         $"{s.Substring(6, 2)}:" +
+                         $"{s.Substring(8, 2)}:" +
+                         $"{s.Substring(10, 2)}");
                 }
                 }
             }
             }
-            return sb.ToString();
+            return isUpper ? sb.ToString().ToUpper() : sb.ToString().ToLower();
         }
         }
     }
     }
 }
 }

+ 6 - 6
README.md

@@ -1,6 +1,6 @@
 # Fork
 # Fork
 
 
-Fork 工具包是平时在做 C# winform 客户端的时候,收藏整理的一个项目,包括各种常用的工具和方法,和窗口控件等。
+Fork 是平时在做 C# 项目的时候,收藏整理的一个工具项目,包括各种常用的工具和方法,窗口控件等。
 
 
 持续完善更新中……
 持续完善更新中……
 
 
@@ -115,7 +115,7 @@ Fork 工具包是平时在做 C# winform 客户端的时候,收藏整理的一
     ┗ ShortcutTool.cs           // 操作快捷方式
     ┗ ShortcutTool.cs           // 操作快捷方式
 ```
 ```
 
 
-#### Azylee.Core.Plus
+### Azylee.Core.Plus
 依赖:Azylee.Core
 依赖:Azylee.Core
 
 
 > - 为其他引用提供扩展
 > - 为其他引用提供扩展
@@ -128,7 +128,7 @@ Fork 工具包是平时在做 C# winform 客户端的时候,收藏整理的一
     ┗ JsonTool.cs               // 开机启动项
     ┗ JsonTool.cs               // 开机启动项
 ```
 ```
 
 
-#### Azylee.Update
+### Azylee.Update
 依赖:Azylee.Core、Azylee.Core.Plus
 依赖:Azylee.Core、Azylee.Core.Plus
 
 
 > - 为exe程序提供升级方案
 > - 为exe程序提供升级方案
@@ -139,7 +139,7 @@ Fork 工具包是平时在做 C# winform 客户端的时候,收藏整理的一
   ┗ AppUpdateTool.cs            // 更新工具
   ┗ AppUpdateTool.cs            // 更新工具
 ```
 ```
 
 
-#### Azylee.YeahWeb
+### Azylee.YeahWeb
 依赖:Azylee.Core、Azylee.Core.Plus
 依赖:Azylee.Core、Azylee.Core.Plus
 
 
 > - 提供网络工具
 > - 提供网络工具
@@ -159,10 +159,10 @@ Fork 工具包是平时在做 C# winform 客户端的时候,收藏整理的一
   ┗ HttpToolPlus.cs             // 增强Http工具(如携带Cookie)
   ┗ HttpToolPlus.cs             // 增强Http工具(如携带Cookie)
 ```
 ```
 
 
-#### Azylee.WinformMan
+### Azylee.WinformMan
 ——暂无
 ——暂无
 
 
-#### Azylee.WinformSkin
+### Azylee.WinformSkin
 ——暂无
 ——暂无
 
 
 ---
 ---