1
1

Program.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using Masuit.Tools;
  2. using Masuit.Tools.AspNetCore.Mime;
  3. using Masuit.Tools.Security;
  4. using Microsoft.AspNetCore;
  5. using Microsoft.AspNetCore.Hosting;
  6. using System;
  7. using System.ComponentModel;
  8. namespace NetCoreTest
  9. {
  10. public class Program
  11. {
  12. public static void Main(string[] args)
  13. {
  14. MimeMapper.ExtTypes.AddOrUpdate(MimeMapper.MimeTypes);
  15. var type = MimeMapper.ExtTypes.AsConcurrentDictionary()[".jpg"];
  16. Console.WriteLine(type);
  17. var rsaKey = RsaCrypt.GenerateRsaKeys(RsaKeyType.PKCS8, 2048);
  18. Console.WriteLine(rsaKey.PrivateKey);
  19. Console.WriteLine(rsaKey.PublicKey);
  20. var enc = "123456".RSAEncrypt();
  21. Console.WriteLine(enc);
  22. Console.Beep();
  23. var dec = enc.RSADecrypt();
  24. Console.WriteLine(dec);
  25. Console.ReadKey();
  26. //CreateWebHostBuilder(args).Build().Run();
  27. }
  28. public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
  29. WebHost.CreateDefaultBuilder(args)
  30. .UseStartup<Startup>();
  31. }
  32. public class MyClass
  33. {
  34. [Description("test")]
  35. public string MyProperty { get; set; }
  36. public int MyProperty1 { get; set; }
  37. }
  38. }