Former-commit-id: 56c9d0f115596d147c90ce5aa6ad242f9ffaf02a
Former-commit-id: 7fdf3cdd803eb9bce36839b84adb224ab03f57f4
1.0
wanggang 5 years ago
parent 7db8e769d1
commit 82d028092f

@ -1,11 +1,11 @@
using MailKit.Net.Smtp;
using MailKit.Net.Smtp;
using MimeKit;
namespace Infrastructure.Email
{
public class EmailSender : IEmailSender
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "CA5359:请勿禁用证书验证", Justification = "<挂起>")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "CA5359:请勿禁用证书验证", Justification = "<挂起>")]
public void SendMail(string name,
string from,
string to,

@ -1,4 +1,4 @@
using System;
using System;
using System.Globalization;
using System.IO;
using System.Security.Cryptography;
@ -8,7 +8,7 @@ namespace Infrastructure.Extensions
{
public static class Md5Extensions
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "CA5351:不要使用损坏的加密算法", Justification = "<挂起>")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "CA5351:不要使用损坏的加密算法", Justification = "<挂起>")]
public static string Md5(this Stream input)
{
using MD5 md5 = MD5.Create();
@ -16,7 +16,7 @@ namespace Infrastructure.Extensions
return BitConverter.ToString(hash).Replace("-", string.Empty, StringComparison.CurrentCulture).ToLower(CultureInfo.CurrentCulture);
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "CA5351:不要使用损坏的加密算法", Justification = "<挂起>")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "CA5351:不要使用损坏的加密算法", Justification = "<挂起>")]
public static string Md5(this string input)
{
using MD5 md5 = MD5.Create();

@ -1,4 +1,4 @@
using HtmlAgilityPack;
using HtmlAgilityPack;
using System;
using System.Globalization;
using System.Linq;
@ -69,7 +69,7 @@ namespace Infrastructure.Extensions
return Enumerable.Range(0, hex.Length / 2).Select(x => Convert.ToByte(hex.Substring(x * 2, 2), 16)).ToArray();
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "CA5351:不要使用损坏的加密算法", Justification = "<挂起>")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "CA5351:不要使用损坏的加密算法", Justification = "<挂起>")]
public static string DESEncrypt(this string value, string key)
{
using var des = new DESCryptoServiceProvider();
@ -89,7 +89,7 @@ namespace Infrastructure.Extensions
return ret.ToString();
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "CA5351:不要使用损坏的加密算法", Justification = "<挂起>")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "CA5351:不要使用损坏的加密算法", Justification = "<挂起>")]
public static string DESDecrypt(this string value, string key)
{
if (value is null)
@ -116,9 +116,9 @@ namespace Infrastructure.Extensions
public static Guid ToGuid(this string input)
{
#pragma warning disable CA5351 // 不要使用损坏的加密算法
#pragma warning disable CA5351 // 不要使用损坏的加密算法
using MD5 md5 = MD5.Create();
#pragma warning restore CA5351 // 不要使用损坏的加密算法
#pragma warning restore CA5351 // 不要使用损坏的加密算法
var hash = md5.ComputeHash(Encoding.UTF8.GetBytes(input));
var guid = new Guid(hash);
//list.Add(input, guid.ToString());

@ -1,4 +1,4 @@
using Infrastructure.Extensions;
using Infrastructure.Extensions;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using System;
@ -16,7 +16,7 @@ namespace Infrastructure.Security
this._configuration = configuration;
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "CA5350:不要使用弱加密算法", Justification = "<挂起>")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Security", "CA5350:不要使用弱加密算法", Justification = "<挂起>")]
public string CreatePasswordHash(string password, string saltkey)
{
var saltAndPassword = String.Concat(password, saltkey);

@ -1,4 +1,4 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
@ -36,9 +36,9 @@ namespace Infrastructure.Sms
{
try
{
#pragma warning disable CA2000 // 丢失范围之前释放对象
#pragma warning disable CA2000 // 丢失范围之前释放对象
var client = this._httpClientFactory.CreateClient();
#pragma warning restore CA2000 // 丢失范围之前释放对象
#pragma warning restore CA2000 // 丢失范围之前释放对象
var formData = new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>("AppKey", this._appKey),
@ -48,9 +48,9 @@ namespace Infrastructure.Sms
formData.Add(new KeyValuePair<string, string>("CurTime", seconds));
var sumValue = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}", this._appSecret, formData[1].Value, formData[2].Value);
var sumBytes = Encoding.UTF8.GetBytes(sumValue);
#pragma warning disable CA5350 // 不要使用弱加密算法
#pragma warning disable CA5350 // 不要使用弱加密算法
using var sha1 = SHA1.Create();
#pragma warning restore CA5350 // 不要使用弱加密算法
#pragma warning restore CA5350 // 不要使用弱加密算法
var sumHash = sha1.ComputeHash(sumBytes);
var hashValue = string.Empty;
var builder = new StringBuilder();

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@ -38,9 +38,9 @@ namespace Infrastructure.UI
options.ContentTypeProvider = contentTypeProvider;
if (options.FileProvider == null && Environment.WebRootFileProvider == null)
{
#pragma warning disable CA1303 // 请不要将文本作为本地化参数传递
#pragma warning disable CA1303 // 请不要将文本作为本地化参数传递
throw new InvalidOperationException("Missing FileProvider.");
#pragma warning restore CA1303 // 请不要将文本作为本地化参数传递
#pragma warning restore CA1303 // 请不要将文本作为本地化参数传递
}
if (this._providers == null)
{

@ -1,5 +1,5 @@
@{
@{
var htmlClass = "form-control select2bs4 search";
var list = (ViewData[ViewData.ModelMetadata.PropertyName + "SelectList"] as SelectList) ?? new SelectList(new List<SelectListItem>());
@Html.DropDownList("", list, "ÇëŃĄÔń", new { @class = htmlClass })
@Html.DropDownList("", list, "请选择", new { @class = htmlClass })
}
Loading…
Cancel
Save