commit ea7e460f24c802d03525ab4782973e5dce3ceb24 Author: itcsx Date: Fri May 15 11:33:41 2026 +0800 上传文件至 / diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..8ecba94 --- /dev/null +++ b/Program.cs @@ -0,0 +1,45 @@ +namespace WinFormsApp6 +{ + internal static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + //string text = OcrSafeHelper.ReadText(@"C:\Users\Owenchen\Pictures\photo\vivos50.PNG"); + //string text = OcrFinalHelper.RecognizeScreenshot(@"C:\Users\Owenchen\Pictures\photo\vivos50.PNG"); + + //string text = OcrLightGrayHelper.RecognizeLightGrayText(@"C:\Users\Owenchen\Pictures\photo\vivos50.PNG"); + string text = OcrFinalHelper.RecognizeScreenshot(@"C:\Users\Owenchen\Pictures\photo\vivos50.PNG"); + Console.WriteLine("识别结果:" + text); + + RSA rSA = new RSA(); + //公钥 + string pubkey = rSA.ToPEM_PKCS1(true); + //私钥 + string priKey = rSA.ToPEM_PKCS1(); + //公钥加密 + RSA rrSA = new RSA(pubkey, true); + string abc123=rrSA.Encode("abc123"); + /* + 前端公钥加密 + let encrypt = new JSEncrypt(); + encrypt.setPublicKey(key); + data.RsaUserPassword = encrypt + .encrypt(data.UserPassword + CryptoJS.MD5(state.LoginData.UserPassword)) + .toString(); + */ + //私钥解密 + + rrSA = new RSA(priKey, true); + string desc = rrSA.DecodeOrNull(abc123); + + // To customize application configuration such as set high DPI settings or default font, + // see https://aka.ms/applicationconfiguration. + ApplicationConfiguration.Initialize(); + Application.Run(new Form1()); + } + } +} \ No newline at end of file