diff --git a/src/AllClassAndInterfaceWellBeManipulatedInThisFileAndCallThroughFunction.cs b/src/AllClassAndInterfaceWellBeManipulatedInThisFileAndCallThroughFunction.cs deleted file mode 100644 index 2853725..0000000 --- a/src/AllClassAndInterfaceWellBeManipulatedInThisFileAndCallThroughFunction.cs +++ /dev/null @@ -1,190 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using WpfApp1.WinOcr; -using WpfApp1.ScnToJson; -using WpfApp1.translationKey; -using WpfApp1.transToNet; - -namespace testRjgc -{ - internal class AllClassAndInterfaceWellBeManipulatedInThisFileAndCallThroughFunction - { - public AllClassAndInterfaceWellBeManipulatedInThisFileAndCallThroughFunction() { } - - TranslationPrivateIn trin = new TranslationPrivateIn(); - TranslationApiStr trstr = new translationPrivateOut(); - TranslationApiInt trint = new translationPublic(); - TranslationScnToJson scnjson = new TranslationScnToJson(); - Sofia sof = new OcrSofia(); - Messiah jsonnet = new jsonNet(); - - public void InputPrivateBaidu(string name, string id, string key) - { - trin.InputBaiduPrivate(name, id, key); - } - - public void InPutPrivateA(string name, List list) - { - trin.InPutPrivate(name, list); - } - - public List OutputNameList() - { - List list = trstr.OutputTranslationNameList(); - return list; - } - - public List OutputStr(string id) - { - List li = trstr.OutputTranslationS(id); - return li; - } - - public List OutputChoicPublic(int id) - { - List li = trint.OutputTranslationI(id); - return li; - } - - public void StartSCNTransJSON() - { - scnjson.StartTrans(); - } - - public void StartTransOneself(string spa, string dps) - { - scnjson.StopTrans(spa, dps); - } - - public string WindowsOcrToGetString(string name) - { - return sof.WindowsOcrToGetStringAndTranslate(name); - } - - public string NetBaiDu(string input) - { - return jsonnet.RequestJsonBaiDu(input); - } - - public string NetAllBaiDu(string input, string srcl, string dstl, string aid, string kkey) - { - return jsonnet.RequestJsonPrivateBaiDu(input, srcl, dstl, aid, kkey); - } - - public string NetLanBaiDu(string input, string srcl, string dstl) - { - return jsonnet.RequestJsonLanguageChangeBaiDu(input, srcl, dstl); - } - - - public string NetXunFei(string input) - { - return jsonnet.RequestJsonXunFei(input); - } - - public string NetLanXunFei(string input, string srcl, string dstl) - { - return jsonnet.RequestJsonLanguageChangeXunFei(input, srcl, dstl); - } - - public string NetAllXunFei(string input, string srcl, string dstl, string xid, string xsecret, string xkey) - { - return jsonnet.RequestJsonPrivateXunFei(input, srcl, dstl, xid, xsecret, xkey); - } - - - - } -} -/* -using System; -using System.Drawing; -using System.Drawing.Imaging; -using System.IO; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; - -namespace OCRConsoleApp -{ - class Program - { - static void Main(string[] args) - { - using IHost host = CreateHostBuilder(args).Build(); - - var ocrService = host.Services.GetRequiredService(); - - // 截图并保存到本地文件 - var bitmap = ocrService.CaptureScreen(); - bitmap.Save("screenshot.png", ImageFormat.Png); - - // 识别图片中的文字 - var text = ocrService.RecognizeText(bitmap); - - Console.WriteLine(text); - } - - private static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureLogging(logging => - { - logging.ClearProviders(); - logging.AddConsole(); - }) - .ConfigureServices((hostContext, services) => - { - services.AddHostedService(); - services.AddSingleton(new OcrService()); - }); - } - - public interface IOcrService - { - Bitmap CaptureScreen(); - string RecognizeText(Bitmap bitmap); - } - - public class OcrService : IOcrService - { - public Bitmap CaptureScreen() - { - var screenBounds = ScreenHelper.GetScreenBounds(); - var bitmap = new Bitmap(screenBounds.Width, screenBounds.Height); - - using (var graphics = Graphics.FromImage(bitmap)) - graphics.CopyFromScreen(screenBounds.X, screenBounds.Y, 0, 0, screenBounds.Size); - - return bitmap; - } - - public string RecognizeText(Bitmap bitmap) - { - var ocrEngine = new IronOcr.AutoOcr(); - - var result = ocrEngine.Read(bitmap); - - return result.Text; - } - } - - public static class ScreenHelper - { - [System.Runtime.InteropServices.DllImport("user32.dll")] - private static extern bool GetCursorPos(out Point lpPoint); - - public static Rectangle GetScreenBounds() - { - GetCursorPos(out Point point); - - var screenBounds = Screen.FromPoint(point).Bounds; - - return screenBounds; - } - } -} - */ - diff --git a/src/ScnToJson/TranslationScnToJson.cs b/src/ScnToJson/TranslationScnToJson.cs deleted file mode 100644 index a997f27..0000000 --- a/src/ScnToJson/TranslationScnToJson.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.Diagnostics; - -namespace WpfApp1.ScnToJson -{ - internal class TranslationScnToJson - { - //private string spath;//scn路径 - //private string dpath;//json - - private string cmdHandle = "cd " + Directory.GetCurrentDirectory() + "\\VNT\\VNTextPatch"; - private string voice = ".\\VNTextPatch extractlocal " + Directory.GetCurrentDirectory() + "\\VNT\\p1 " + Directory.GetCurrentDirectory() + "\\VNT\\p2"; - - public void StartTrans() - { - this.DirExsis("VNT\\p1"); - this.DirExsis("VNT\\p2"); - - var p = new Process - { - StartInfo = - { - FileName = "PowerShell.exe", - Arguments = "/c " + cmdHandle + "\n" + voice, - UseShellExecute = false, - CreateNoWindow = false, - } - }; - p.Start(); - p.WaitForExit(); - p.Close(); - - } - - public void DirExsis(string id) - { - if(Directory.Exists(Directory.GetCurrentDirectory() + "\\" + id)) - { - Directory.CreateDirectory(Directory.GetCurrentDirectory() + "\\" + id); - } - } - - public void StopTrans(string spa, string dps)//自选路径 - { - string tempVoice = ".\\VNTextPatch extractlocal " + spa + " " + dps; - - var p = new Process - { - StartInfo = - { - FileName = "PowerShell.exe", - Arguments = "/c " + cmdHandle + "\n" + tempVoice, - UseShellExecute = false, - CreateNoWindow = false, - } - }; - p.Start(); - p.WaitForExit(); - p.Close(); - } - - - - - } -} \ No newline at end of file diff --git a/src/ScnToJson/VNT/VNTextPatch/BouncyCastle.Crypto.dll b/src/ScnToJson/VNT/VNTextPatch/BouncyCastle.Crypto.dll deleted file mode 100644 index 967a933..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/BouncyCastle.Crypto.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/FastBitmapLib.dll b/src/ScnToJson/VNT/VNTextPatch/FastBitmapLib.dll deleted file mode 100644 index 76dfe7e..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/FastBitmapLib.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/FreeMote.Psb.dll b/src/ScnToJson/VNT/VNTextPatch/FreeMote.Psb.dll deleted file mode 100644 index 883d5ec..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/FreeMote.Psb.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/FreeMote.dll b/src/ScnToJson/VNT/VNTextPatch/FreeMote.dll deleted file mode 100644 index 2cdf1a3..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/FreeMote.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/Google.Apis.Auth.PlatformServices.dll b/src/ScnToJson/VNT/VNTextPatch/Google.Apis.Auth.PlatformServices.dll deleted file mode 100644 index 2e574be..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/Google.Apis.Auth.PlatformServices.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/Google.Apis.Auth.dll b/src/ScnToJson/VNT/VNTextPatch/Google.Apis.Auth.dll deleted file mode 100644 index 5c91ff5..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/Google.Apis.Auth.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/Google.Apis.Core.dll b/src/ScnToJson/VNT/VNTextPatch/Google.Apis.Core.dll deleted file mode 100644 index bd66ade..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/Google.Apis.Core.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/Google.Apis.PlatformServices.dll b/src/ScnToJson/VNT/VNTextPatch/Google.Apis.PlatformServices.dll deleted file mode 100644 index db75bca..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/Google.Apis.PlatformServices.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/Google.Apis.Sheets.v4.dll b/src/ScnToJson/VNT/VNTextPatch/Google.Apis.Sheets.v4.dll deleted file mode 100644 index 4f6f1fb..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/Google.Apis.Sheets.v4.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/Google.Apis.dll b/src/ScnToJson/VNT/VNTextPatch/Google.Apis.dll deleted file mode 100644 index 9243ac6..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/Google.Apis.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/ICSharpCode.SharpZipLib.dll b/src/ScnToJson/VNT/VNTextPatch/ICSharpCode.SharpZipLib.dll deleted file mode 100644 index 4dc2759..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/ICSharpCode.SharpZipLib.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/Microsoft.IO.RecyclableMemoryStream.dll b/src/ScnToJson/VNT/VNTextPatch/Microsoft.IO.RecyclableMemoryStream.dll deleted file mode 100644 index b191837..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/Microsoft.IO.RecyclableMemoryStream.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/NPOI.OOXML.dll b/src/ScnToJson/VNT/VNTextPatch/NPOI.OOXML.dll deleted file mode 100644 index 9d9b5e8..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/NPOI.OOXML.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/NPOI.OpenXml4Net.dll b/src/ScnToJson/VNT/VNTextPatch/NPOI.OpenXml4Net.dll deleted file mode 100644 index 0587a28..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/NPOI.OpenXml4Net.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/NPOI.OpenXmlFormats.dll b/src/ScnToJson/VNT/VNTextPatch/NPOI.OpenXmlFormats.dll deleted file mode 100644 index 910e7ae..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/NPOI.OpenXmlFormats.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/NPOI.dll b/src/ScnToJson/VNT/VNTextPatch/NPOI.dll deleted file mode 100644 index cab5a09..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/NPOI.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/Newtonsoft.Json.dll b/src/ScnToJson/VNT/VNTextPatch/Newtonsoft.Json.dll deleted file mode 100644 index e4a6339..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/Newtonsoft.Json.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/System.Buffers.dll b/src/ScnToJson/VNT/VNTextPatch/System.Buffers.dll deleted file mode 100644 index f2d83c5..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/System.Buffers.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/System.Diagnostics.DiagnosticSource.dll b/src/ScnToJson/VNT/VNTextPatch/System.Diagnostics.DiagnosticSource.dll deleted file mode 100644 index c35584d..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/System.Diagnostics.DiagnosticSource.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/System.Memory.dll b/src/ScnToJson/VNT/VNTextPatch/System.Memory.dll deleted file mode 100644 index 5d19470..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/System.Memory.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/System.Numerics.Vectors.dll b/src/ScnToJson/VNT/VNTextPatch/System.Numerics.Vectors.dll deleted file mode 100644 index 0865972..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/System.Numerics.Vectors.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/System.Runtime.CompilerServices.Unsafe.dll b/src/ScnToJson/VNT/VNTextPatch/System.Runtime.CompilerServices.Unsafe.dll deleted file mode 100644 index c5ba4e4..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/System.Runtime.CompilerServices.Unsafe.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/System.ValueTuple.dll b/src/ScnToJson/VNT/VNTextPatch/System.ValueTuple.dll deleted file mode 100644 index 4ce28fd..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/System.ValueTuple.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/VNTextPatch.Shared.dll b/src/ScnToJson/VNT/VNTextPatch/VNTextPatch.Shared.dll deleted file mode 100644 index 1f24417..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/VNTextPatch.Shared.dll and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/VNTextPatch.exe b/src/ScnToJson/VNT/VNTextPatch/VNTextPatch.exe deleted file mode 100644 index 40e70c1..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/VNTextPatch.exe and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/VNTextPatch.exe.config b/src/ScnToJson/VNT/VNTextPatch/VNTextPatch.exe.config deleted file mode 100644 index 318bcce..0000000 --- a/src/ScnToJson/VNT/VNTextPatch/VNTextPatch.exe.config +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ScnToJson/VNT/VNTextPatch/names.xml b/src/ScnToJson/VNT/VNTextPatch/names.xml deleted file mode 100644 index e16d181..0000000 --- a/src/ScnToJson/VNT/VNTextPatch/names.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/src/ScnToJson/VNT/VNTextPatch/template.xlsx b/src/ScnToJson/VNT/VNTextPatch/template.xlsx deleted file mode 100644 index 8bc6b4e..0000000 Binary files a/src/ScnToJson/VNT/VNTextPatch/template.xlsx and /dev/null differ diff --git a/src/ScnToJson/VNT/VNTextPatch/使用方法.txt b/src/ScnToJson/VNT/VNTextPatch/使用方法.txt deleted file mode 100644 index 6d5ac6d..0000000 --- a/src/ScnToJson/VNT/VNTextPatch/使用方法.txt +++ /dev/null @@ -1,7 +0,0 @@ -Excel: -VNTextPatch extractlocal script.xlsx -VNTextPatch insertlocal script.xlsx - -JSON: -VNTextPatch extractlocal -VNTextPatch insertlocal \ No newline at end of file diff --git a/src/WinOcr/OcrSofia.cs b/src/WinOcr/OcrSofia.cs deleted file mode 100644 index a8fab90..0000000 --- a/src/WinOcr/OcrSofia.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System.Drawing; -using System; -using System.Drawing; -using System.Drawing.Imaging; -using System.IO; -using System.Runtime.InteropServices; -//using System.Windows.Forms; - -namespace WpfApp1.WinOcr -{ - internal class OcrSofia : Sofia - { - static string path = Directory.GetCurrentDirectory() + "\\TempImage"; - - public OcrSofia() { } - - public string WindowsOcrToGetStringAndTranslate(string name) - { - string retxt = ""; - - this.DirExists(); - //Image image = null; - /* - MODI.Document modiDocument = new MODI.Document(); - modiDocument.Create(path + "\\" + name + ".jpg"); - modiDocument.OCR(MODI.MiLANGUAGES.miLANG_CHINESE_SIMPLIFIED, true, true); - MODI.Image modiImage = (MODI.Image)modiDocument.Images[0]; - retxt = modiImage.Layout.Text; - */ - return retxt; - /* - string processName = "notepad"; // 替换为要跟踪的进程名称 - Process[] processes = Process.GetProcessesByName(processName); - if (processes.Length > 0) - { - Process process = processes[0]; - IntPtr hwnd = process.MainWindowHandle; - var Ocr = new IronTesseract(); - OcrResult Result = null; - Ocr.TextAvailable += (s, e) => - { - Console.WriteLine(e.Text); - Result = e.Result; - }; - while (true) - { - if (hwnd != IntPtr.Zero) - { - int length = GetWindowTextLength(hwnd); - if (length > 0) - { - IntPtr buffer = Marshal.AllocHGlobal(length + 1); - GetWindowText(hwnd, buffer, length + 1); - string text = Marshal.PtrToStringAnsi(buffer); - Marshal.FreeHGlobal(buffer); - Ocr.Read(text); - } - } - } - } - else - { - Console.WriteLine("找不到进程:{0}", processName); - } - */ - } - - public void DirExists() - { - if(Directory.Exists(path)) - { - Directory.CreateDirectory(path); - } - } - -/* -internal class OcrSofia : Sofia - { - public OcrSofia() { } - - public string WindowsOcrToGetStringAndTranslate() - { - string result = ""; - - // 获取剪贴板中的图像 - Image image = Clipboard.GetImage(); - - // 将图像保存到临时文件中 - string tempFile = Path.GetTempFileName(); - image.Save(tempFile, ImageFormat.Tiff); - - // 使用Windows OCR引擎识别图像中的文本 - MODI.Document modiDocument = new MODI.Document(); - modiDocument.Create(tempFile); - modiDocument.OCR(MODI.MiLANGUAGES.miLANG_CHINESE_SIMPLIFIED, true, true); - MODI.Image modiImage = (MODI.Image)modiDocument.Images[0]; - result = modiImage.Layout.Text; - - // 删除临时文件 - File.Delete(tempFile); - - return result; - } - } -*/ - } -} diff --git a/src/WinOcr/Sofia.cs b/src/WinOcr/Sofia.cs deleted file mode 100644 index 9e3b73e..0000000 --- a/src/WinOcr/Sofia.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace WpfApp1.WinOcr -{ - internal interface Sofia - { - public abstract string WindowsOcrToGetStringAndTranslate(string name); - } -} diff --git a/src/translationKey/translationApi.cs b/src/translationKey/translationApi.cs deleted file mode 100644 index a95cfe9..0000000 --- a/src/translationKey/translationApi.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace WpfApp1.translationKey -{ - - interface TranslationApiStr//Mohammed - { - - public abstract List OutputTranslationS(string id); - public abstract List OutputTranslationNameList(); - - } - - interface TranslationApiInt - { - public abstract List OutputTranslationI(int id); - } -} diff --git a/src/translationKey/translationPrivateIn.cs b/src/translationKey/translationPrivateIn.cs deleted file mode 100644 index c6d969a..0000000 --- a/src/translationKey/translationPrivateIn.cs +++ /dev/null @@ -1,61 +0,0 @@ -namespace WpfApp1.translationKey -{ - class TranslationPrivateIn - { - private static string pathTemp = Directory.GetCurrentDirectory() + "\\translationResource"; - private static string txtPath = Directory.GetCurrentDirectory() + "\\translationResource\\ListPrivate.txt"; - - public TranslationPrivateIn() { } - - public void InPutPrivate(string name, List list) - { - if (Directory.Exists(pathTemp)) - { - Directory.CreateDirectory(pathTemp); - } - - string temppathTemp = pathTemp + "\\" + name + ".txt"; - StreamWriter sw = new StreamWriter(temppathTemp); - StreamWriter sw2 = new StreamWriter(txtPath); - - foreach (string s in list) - { - sw.WriteLine(s); - } - - sw2.WriteLine(name); - sw.Close(); - sw2.Close(); - } - - public void InputBaiduPrivate(string name, string id, string key)//该函数仅百度支持 - { - if(Directory.Exists(pathTemp)) - { - Directory.CreateDirectory(pathTemp); - } - - string temppathTemp = pathTemp + "\\" + name + ".txt"; - StreamWriter sw = new StreamWriter(temppathTemp); - StreamWriter sw2 = new StreamWriter(txtPath); - - InputTranslationId(id,sw); - InputTranslationKey(key,sw); - - sw2.WriteLine(name); - sw.Close(); - sw2.Close(); - } - - public void InputTranslationId(string id, StreamWriter sw) - { - - sw.WriteLine(id); - } - - public void InputTranslationKey(string key, StreamWriter sw) - { - sw.WriteLine(key); - } - } -} diff --git a/src/translationKey/translationPrivateOut.cs b/src/translationKey/translationPrivateOut.cs deleted file mode 100644 index 1900399..0000000 --- a/src/translationKey/translationPrivateOut.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace WpfApp1.translationKey -{ - class translationPrivateOut : TranslationApiStr - { - private static string path = Directory.GetCurrentDirectory() + "\\translationResource"; - private static string txtPath = Directory.GetCurrentDirectory() + "\\translationResource\\ListPrivate.txt"; - - private String getTranslationPrivateApi(StreamReader sr) - { - String temp = sr.ReadLine(); - - if(temp != null) - { - return temp; - } - else - { - return "ERROR"; - } - - } - - private String getTranslationPrivateKey(StreamReader sr) - { - String temp = sr.ReadLine(); - - if (temp != null) - { - return temp; - } - else - { - return "ERROR"; - } - - } - - public string getpath(string id) - { - return path + "\\" + id + ".txt"; - } - - public string gettxt() - { - return txtPath; - } - - public List OutputTranslationS(string id) - { - string temppath = path + "\\" + id + ".txt"; - - List temp = new List { }; - - if (Directory.Exists(temppath))//若不存在 - { - temp.Add("尚未输入!!!"); - return temp; - } - - - StreamReader sr = new StreamReader(temppath); - - - temp.Add(this.getTranslationPrivateApi(sr)); - temp.Add(this.getTranslationPrivateKey(sr)); - - sr.Close(); - return temp; - } - - public List OutputTranslationNameList() - { - List temp = new List { }; - string temptxtpath = txtPath; - - if(Directory.Exists(temptxtpath)) - { - temp.Add("ERROR"); - return temp; - } - - - StreamReader sr = new StreamReader(temptxtpath); - string temp2 = sr.ReadLine(); - if (temp2 == null) - { - temp.Add("ERROR"); - } - else - { - while (temp2 != null) - { - temp.Add(temp2); - temp2 = sr.ReadLine(); - } - } - - sr.Close(); - return temp; - } - } -} diff --git a/src/translationKey/translationPublic.cs b/src/translationKey/translationPublic.cs deleted file mode 100644 index 64122fd..0000000 --- a/src/translationKey/translationPublic.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace WpfApp1.translationKey -{ - class translationPublic : TranslationApiInt - { - - public List OutputTranslationI(int id) - { - var temp = new List { }; - switch (id) - { - case 0://讯飞 - { - temp.Add("1299c840");//id - temp.Add("M2Q4YzkzZTIwZjNkMGE2ZjkwZWMxNzZk");//APISecret - temp.Add("828cb2dc915d28464a904bda5d7b01b3");//APIKey - break; - } - case 1://百度 - { - temp.Add("20230923001827495");//APIAppid - temp.Add("yjvMNY33Qc1TYSBjTQYQ");//APIKey - break; - } - case 2://百度2 - { - temp.Add("20230925001829663"); - temp.Add("f7ZHpw28izQ1VU_ixoY5"); - break; - } - case 3://google - { - temp.Add("UNSET!");//NULL,空 - temp.Add("UNSET!");//APIKey - break; - } - } - return temp; - } - } -} diff --git a/src/translationKey/translationResource/ListPrivate.txt b/src/translationKey/translationResource/ListPrivate.txt deleted file mode 100644 index e69de29..0000000