Browse Source

历史代码提交

callm 1 year ago
parent
commit
44cfb87831

+ 3 - 3
FileAnalysis/App.config

@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="utf-8" ?>
+<?xml version="1.0" encoding="utf-8"?>
 <configuration>
     <startup> 
-        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
     </startup>
-</configuration>
+</configuration>

+ 3 - 1
FileAnalysis/FileAnalysis.csproj

@@ -9,9 +9,10 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>FileAnalysis</RootNamespace>
     <AssemblyName>FileAnalysis</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <TargetFrameworkProfile />
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <PlatformTarget>AnyCPU</PlatformTarget>
@@ -86,6 +87,7 @@
     <Compile Include="Properties\Resources.Designer.cs">
       <AutoGen>True</AutoGen>
       <DependentUpon>Resources.resx</DependentUpon>
+      <DesignTime>True</DesignTime>
     </Compile>
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>

+ 78 - 5
FileAnalysis/Form1.cs

@@ -1,6 +1,13 @@
-using System;
+using NPOI.SS.Formula.Functions;
+using NPOI.SS.UserModel;
+using System;
 using System.Collections.Generic;
+using System.IO;
+using System.Net;
+using System.Security.Cryptography;
+using System.Text;
 using System.Windows.Forms;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
 
 namespace FileAnalysis
 {
@@ -14,12 +21,78 @@ namespace FileAnalysis
 
         private void Analysis_Click(object sender, EventArgs e)
         {
-            Result.Clear();
-            int[] list = GetDecimalData(ReturnData.Text, new int[] { 8, 8, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 4 }, new int[] { 6 });
-            for (int i = 0; i < list.Length; i++)
+            string url = "https://openapi.seewo.com/seewo-study-machine/device-manager/check-activate";
+            HttpWebRequest webrequest = (HttpWebRequest)WebRequest.Create(url);
+            webrequest.Method = "POST";
+            webrequest.Timeout = 1000;
+            webrequest.ContentType = "application/x-www-form-urlencoded";
+            string secret = "QmxcghPaupQjjSOTV3NJLkPeyycEBuYk";
+            System.Collections.Hashtable pars = new System.Collections.Hashtable();
+            string sign = "x-sw-app-id3a1252d81dff4fd3b1ece153b3a9cb71x-sw-req-path/seewo-study-machine/device-manager/check-activatex-sw-version2";
+            webrequest.Headers.Add("x-sw-app-id", "3a1252d81dff4fd3b1ece153b3a9cb71"); //必填
+            webrequest.Headers.Add("x-sw-sign", GETMD5(secret + sign + secret));//必填
+            webrequest.Headers.Add("x-sw-req-path", "/seewo-study-machine/device-manager/check-activate");//必填
+            webrequest.Headers.Add("x-sw-version", "2");//必填
+            //webrequest.Headers.Add("x-sw-sign-type", "");
+            //webrequest.Headers.Add("x-sw-sign-headers", "");
+            //webrequest.Headers.Add("x-sw-timestamp", "");
+            //webrequest.Headers.Add("x-sw-content-md5", "");c
+            pars.Add("sn", "{sn:123}");
+            string buffer = "";
+            //发送POST数据 
+            if (!(pars == null || pars.Count == 0))
             {
-                Result.AppendText(list[i] + "\n");
+                foreach (string key in pars.Keys)
+                {
+                    buffer = buffer + "&" + key + "=" + pars[key].ToString();
+                }
+                byte[] data = Encoding.UTF8.GetBytes(buffer);
+                using (Stream stream = webrequest.GetRequestStream())
+                {
+                    stream.Write(data, 0, data.Length);
+                }
+            }
+
+            string[] values = webrequest.Headers.GetValues("Content-Type");
+            WebResponse myResponse = webrequest.GetResponse();
+
+            using (Stream resStream = myResponse.GetResponseStream())//得到回写的流
+            {
+                StreamReader newReader = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8);
+
+                string Content = newReader.ReadToEnd();
+                ReturnData.Text = Content;
+                Dictionary<string, object> dic = new Dictionary<string, object>();
+                //dic = BaseUtil.ToDictionary(Content);
+                //if (!dic.ContainsKey("erpaccount"))
+                //{
+                //    oMsg = dic["reason"].ToString();
+                //    return false;
+                //}
+                newReader.Close();
+            }
+        }
+
+        private string GETMD5(string password)
+        {
+            //初始化MD5对象
+            MD5 md5 = MD5.Create();
+
+            //将源字符串转化为byte数组
+            Byte[] soucebyte = Encoding.Default.GetBytes(password);
+
+            //soucebyte转化为mf5的byte数组
+            Byte[] md5bytes = md5.ComputeHash(soucebyte);
+
+            //将md5的byte数组再转化为MD5数组
+            StringBuilder sb = new StringBuilder();
+            foreach (Byte b in md5bytes)
+            {
+                //x表示16进制,2表示2位
+                sb.Append(b.ToString("x2"));
+
             }
+            return sb.ToString();
         }
 
         public static int[] GetDecimalData(string HexStr, int[] DataSize, int[] NotShow)

+ 26 - 34
FileAnalysis/Properties/Resources.Designer.cs

@@ -1,69 +1,61 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     此代码由工具生成。
-//     运行时版本: 4.0.30319.42000
+//     运行时版本:4.0.30319.42000
 //
-//     对此文件的更改可能导致不正确的行为,如果
-//     重新生成代码,则所做更改将丢失。
+//     对此文件的更改可能导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace FileAnalysis.Properties
-{
-
-
+namespace FileAnalysis.Properties {
+    using System;
+    
+    
     /// <summary>
-    ///   强类型资源类,用于查找本地化字符串等。
+    ///   一个强类型资源类,用于查找本地化字符串等。
     /// </summary>
     // 此类是由 StronglyTypedResourceBuilder
     // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
-    // 若要添加或除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // 若要添加或除成员,请编辑 .ResX 文件,然后重新运行 ResGen
     // (以 /str 作为命令选项),或重新生成 VS 项目。
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resources
-    {
-
+    internal class Resources {
+        
         private static global::System.Resources.ResourceManager resourceMan;
-
+        
         private static global::System.Globalization.CultureInfo resourceCulture;
-
+        
         [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal Resources()
-        {
+        internal Resources() {
         }
-
+        
         /// <summary>
-        ///   返回此类使用的缓存 ResourceManager 实例。
+        ///   返回此类使用的缓存 ResourceManager 实例。
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager
-        {
-            get
-            {
-                if ((resourceMan == null))
-                {
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
                     global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FileAnalysis.Properties.Resources", typeof(Resources).Assembly);
                     resourceMan = temp;
                 }
                 return resourceMan;
             }
         }
-
+        
         /// <summary>
-        ///   覆盖当前线程的 CurrentUICulture 属性
-        ///   使用此强类型资源类的资源查找。
+        ///   重写当前线程的 CurrentUICulture 属性,对
+        ///   使用此强类型资源类的所有资源查找执行重写
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture
-        {
-            get
-            {
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
                 return resourceCulture;
             }
-            set
-            {
+            set {
                 resourceCulture = value;
             }
         }

+ 13 - 17
FileAnalysis/Properties/Settings.Designer.cs

@@ -1,28 +1,24 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.42000
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
 //
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace FileAnalysis.Properties
-{
-
-
+namespace FileAnalysis.Properties {
+    
+    
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
-    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
-    {
-
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.6.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
-        public static Settings Default
-        {
-            get
-            {
+        
+        public static Settings Default {
+            get {
                 return defaultInstance;
             }
         }

BIN
FileAnalysis/tool/Spire.Common.dll


BIN
FileAnalysis/tool/Spire.License.dll


BIN
FileAnalysis/tool/Spire.Pdf.dll


BIN
FileAnalysis/tool/Spire.XLS.dll