软件升级相关代码
This commit is contained in:
1 parent
93e5e36dd3
commit
892d7e1f6c
20 files changed
+1697
-3
No files matched your search
+25
-1
@@ -7,6 +7,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -26,7 +27,7 @@ namespace AllBase
|
||||
/// <summary>
|
||||
/// 版本ID
|
||||
/// </summary>
|
||||
public static int VersionCount = 357;
|
||||
public static int VersionCount = 358;
|
||||
|
||||
/// <summary>
|
||||
/// 版本号
|
||||
@@ -614,6 +615,29 @@ namespace AllBase
|
||||
return BitConverter.ToString(output).Replace("-", "");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取文件MD5值
|
||||
/// </summary>
|
||||
/// <param name="FilePath"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetFileMd5(string FilePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
FileStream get_file = new FileStream(FilePath, FileMode.Open, FileAccess.Read, FileShare.Read);
|
||||
System.Security.Cryptography.MD5CryptoServiceProvider get_md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();
|
||||
byte[] hash_byte = get_md5.ComputeHash(get_file);
|
||||
string resule = System.BitConverter.ToString(hash_byte);
|
||||
resule = resule.Replace("-", "");
|
||||
get_file.Close();
|
||||
return resule;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return e.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// MD5加密
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user