Files
Masuit.Tools/NetCoreTest/Program.cs
T
懒得勤快 af7773dee9 1.MimeMapper增加mime类型与扩展名的映射关系
2.Dictionary增加扩展方法
2020-08-19 13:42:19 +08:00

44 lines
1.3 KiB
C#

using Masuit.Tools;
using Masuit.Tools.AspNetCore.Mime;
using Masuit.Tools.Security;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using System;
using System.ComponentModel;
namespace NetCoreTest
{
public class Program
{
public static void Main(string[] args)
{
MimeMapper.ExtTypes.AddOrUpdate(MimeMapper.MimeTypes);
var type = MimeMapper.ExtTypes.AsConcurrentDictionary()[".jpg"];
Console.WriteLine(type);
var rsaKey = RsaCrypt.GenerateRsaKeys(RsaKeyType.PKCS8, 2048);
Console.WriteLine(rsaKey.PrivateKey);
Console.WriteLine(rsaKey.PublicKey);
var enc = "123456".RSAEncrypt();
Console.WriteLine(enc);
Console.Beep();
var dec = enc.RSADecrypt();
Console.WriteLine(dec);
Console.ReadKey();
//CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>();
}
public class MyClass
{
[Description("test")]
public string MyProperty { get; set; }
public int MyProperty1 { get; set; }
}
}