Program.cs 1.1 KB

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