提交当前本机整理版本
This commit is contained in:
@@ -1086,4 +1086,36 @@ namespace Lskj.QueryEssentialInfo
|
||||
{
|
||||
byte[] inputBytes = Encoding.UTF8.GetBytes(input);
|
||||
byte[] hashBytes = md5.ComputeHash(inputBytes);
|
||||
StringBuilder sb = new StringBuil
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < hashBytes.Length; i++)
|
||||
{
|
||||
sb.Append(hashBytes[i].ToString("x2"));
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 修改表结构
|
||||
/// </summary>
|
||||
/// <param name="tableName"></param>
|
||||
/// <param name="colName"></param>
|
||||
/// <param name="type"></param>
|
||||
public static bool AlterTable(string tableName, string colName, string colType)
|
||||
{
|
||||
bool isResult;
|
||||
try
|
||||
{
|
||||
if (!BaseImpl.HasExistsColumn(tableName, colName))
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(string.Format("alter table {0} add {1} {2}", tableName, colName, colType));
|
||||
}
|
||||
isResult = true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
isResult = false;
|
||||
}
|
||||
return isResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user