From bdb79e8f655031d0a3dcb3cf4d6d24a82cfef526 Mon Sep 17 00:00:00 2001
From: root <295172551@qq.com>
Date: Sun, 29 Jun 2025 16:41:20 +0800
Subject: [PATCH] dasdad1
---
LTEMvcApp/Models/ASN1Extensions.cs | 270 +++++++++++++++++
LTEMvcApp/Models/ASN1Parser.cs | 365 +++++++++++++++++++++++
LTEMvcApp/Models/LTECapabilities.cs | 441 ++++++++++++++++++++++++++++
LTEMvcApp/Models/LTEClient.cs | 3 +-
LTEMvcApp/Models/StatisticsData.cs | 11 +-
5 files changed, 1086 insertions(+), 4 deletions(-)
create mode 100644 LTEMvcApp/Models/ASN1Extensions.cs
create mode 100644 LTEMvcApp/Models/ASN1Parser.cs
create mode 100644 LTEMvcApp/Models/LTECapabilities.cs
diff --git a/LTEMvcApp/Models/ASN1Extensions.cs b/LTEMvcApp/Models/ASN1Extensions.cs
new file mode 100644
index 0000000..d3908a3
--- /dev/null
+++ b/LTEMvcApp/Models/ASN1Extensions.cs
@@ -0,0 +1,270 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace LTEMvcApp.Models
+{
+ ///
+ /// ASN1扩展方法
+ ///
+ public static class ASN1Extensions
+ {
+ ///
+ /// 安全获取字典值
+ ///
+ public static T GetValueOrDefault(this Dictionary dict, string key, T defaultValue = default(T))
+ {
+ if (dict != null && dict.ContainsKey(key))
+ {
+ try
+ {
+ return (T)Convert.ChangeType(dict[key], typeof(T));
+ }
+ catch
+ {
+ return defaultValue;
+ }
+ }
+ return defaultValue;
+ }
+
+ ///
+ /// 安全获取字典值
+ ///
+ public static object GetValueOrDefault(this Dictionary dict, string key)
+ {
+ return dict?.ContainsKey(key) == true ? dict[key] : null;
+ }
+
+ ///
+ /// 将对象转换为字典
+ ///
+ public static Dictionary ToDictionary(this object obj)
+ {
+ if (obj is Dictionary dict)
+ return dict;
+
+ if (obj is IDictionary idict)
+ return new Dictionary(idict);
+
+ return null;
+ }
+
+ ///
+ /// 将对象转换为列表
+ ///
+ public static List