From ab2e06535a536d63b8b107fc5e48ded73bf6c980 Mon Sep 17 00:00:00 2001 From: lilium-saber Date: Thu, 12 Oct 2023 22:04:54 +0800 Subject: [PATCH] 0 Signed-off-by: lilium-saber --- src/translationKey/translationPrivateOut.cs | 21 +++++++++++++++++---- src/translationKey/translationPublic.cs | 4 ++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/translationKey/translationPrivateOut.cs b/src/translationKey/translationPrivateOut.cs index b27ff60..5ae0e6b 100644 --- a/src/translationKey/translationPrivateOut.cs +++ b/src/translationKey/translationPrivateOut.cs @@ -42,16 +42,28 @@ namespace WpfApp1.translationKey } + public string getpath(string id) + { + return path + "\\" + id + ".txt"; + } + + public string gettxt() + { + return txtPath; + } + public List OutputTranslationS(string id) { string temppath = path + "\\" + id + ".txt"; - var temp = new List { }; - if (!Directory.Exists(temppath)) + List temp = new List { }; + + if (Directory.Exists(temppath)) { temp.Add("ERROR"); return temp; } + StreamReader sr = new StreamReader(temppath); @@ -67,12 +79,13 @@ namespace WpfApp1.translationKey { List temp = new List { }; string temptxtpath = txtPath; - - if(!Directory.Exists(temptxtpath)) + + if(Directory.Exists(temptxtpath)) { temp.Add("ERROR"); return temp; } + StreamReader sr = new StreamReader(temptxtpath); string temp2 = sr.ReadLine(); diff --git a/src/translationKey/translationPublic.cs b/src/translationKey/translationPublic.cs index a965aea..7112139 100644 --- a/src/translationKey/translationPublic.cs +++ b/src/translationKey/translationPublic.cs @@ -22,8 +22,8 @@ namespace WpfApp1.translationKey } case 1://百度 { - temp.Add("");//APIAppid - temp.Add("");//APIKey + temp.Add("20230923001827495");//APIAppid + temp.Add("yjvMNY33Qc1TYSBjTQYQ");//APIKey break; } case 2://google