public static string Getkeybyocr(string s) { string Path = s; string a = generalBasic(Path); Console.WriteLine(a); byte[] byteArray = System.Text.Encoding.Default.GetBytes(a); string str = System.Text.Encoding.Default.GetString(byteArray); Console.WriteLine(str); byte[] re = UTF32Encoding.Convert(UTF8Encoding.UTF8, UTF32Encoding.Default, byteArray); str = System.Text.Encoding.Default.GetString(re); Console.WriteLine(str); string[] key = str.Split('"'); Console.WriteLine(key[9]); return(key[9]); }
public static string Getkeybyocr(string s) { try { string Path = s; string a = GetOcr(Path); Console.WriteLine(a); byte[] byteArray = System.Text.Encoding.Default.GetBytes(a); string str = System.Text.Encoding.Default.GetString(byteArray); Console.WriteLine(str); byte[] re = UTF32Encoding.Convert(UTF8Encoding.UTF8, UTF32Encoding.Default, byteArray); str = System.Text.Encoding.Default.GetString(re); Console.WriteLine(str); string[] key = str.Split('"'); Console.WriteLine(key[9]); return(key[9]); } catch (Exception e) { throw new Exception("cuowu"); } }