Signed-off-by: lilium-saber <WR364999428@hotmail.com>
GDN
lilium-saber 1 year ago
parent 24095d15ba
commit 2e225854ea

@ -1,8 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WpfApp2.translationKey namespace WpfApp2.translationKey
{ {
@ -11,12 +7,8 @@ namespace WpfApp2.translationKey
{ {
public abstract List<string> OutputTranslationS(string id); public abstract List<string> OutputTranslationS(string id);
public abstract List<string> OutputTranslationNameList(); public abstract List<string> OutputTranslationNameList();
public abstract bool GetExistsD();
public abstract bool GetExistsF(string name);
} }
interface TranslationApiInt interface TranslationApiInt

@ -1,27 +1,14 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WpfApp2.translationKey namespace WpfApp2.translationKey;
{
class translationPrivateOut : TranslationApiStr class translationPrivateOut : TranslationApiStr
{ {
private static string path = Directory.GetCurrentDirectory() + "\\translationResource"; private static string path = Directory.GetCurrentDirectory() + "\\translationResource";
private static string txtPath = Directory.GetCurrentDirectory() + "\\translationResource\\ListPrivate.txt"; private static string txtPath = Directory.GetCurrentDirectory() + "\\translationResource\\ListPrivate.txt";
public bool GetExistsD()
{
return Directory.Exists(path);
}
public bool GetExistsF(string name)
{
return Directory.Exists(txtPath + "\\" + name + ".txt");
}
private String getTranslationPrivateApi(StreamReader sr) private String getTranslationPrivateApi(StreamReader sr)
{ {
String temp = sr.ReadLine(); String temp = sr.ReadLine();
@ -70,17 +57,16 @@ namespace WpfApp2.translationKey
if (Directory.Exists(temppath))//若不存在 if (Directory.Exists(temppath))//若不存在
{ {
temp.Add(temppath); temp.Add("尚未输入!!!");
return temp; return temp;
} }
StreamReader sr = new StreamReader(temppath); StreamReader sr = new StreamReader(temppath);
string temp2 = sr.ReadLine();
while(temp2 != null && temp2 != "")
{ temp.Add(this.getTranslationPrivateApi(sr));
temp.Add(temp2); temp.Add(this.getTranslationPrivateKey(sr));
temp2 = sr.ReadLine();
}
sr.Close(); sr.Close();
return temp; return temp;
@ -93,15 +79,16 @@ namespace WpfApp2.translationKey
if (Directory.Exists(temptxtpath)) if (Directory.Exists(temptxtpath))
{ {
temp.Add("ERROR1"); temp.Add("ERROR");
return temp; return temp;
} }
StreamReader sr = new StreamReader(temptxtpath); StreamReader sr = new StreamReader(temptxtpath);
string temp2 = sr.ReadLine(); string temp2 = sr.ReadLine();
if (temp2 == null) if (temp2 == null)
{ {
temp.Add("ERROR2"); temp.Add("ERROR");
} }
else else
{ {
@ -116,4 +103,10 @@ namespace WpfApp2.translationKey
return temp; return temp;
} }
} }
class customTransApi
{
private string ID { get; set; }
private string KEY { get; set; }
private string SECRET { get; set; }
} }

@ -1,8 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WpfApp2.translationKey namespace WpfApp2.translationKey
{ {
@ -17,8 +13,8 @@ namespace WpfApp2.translationKey
case 0://讯飞 case 0://讯飞
{ {
temp.Add("1299c840");//id temp.Add("1299c840");//id
temp.Add("828cb2dc915d28464a904bda5d7b01b3");//APIKey
temp.Add("M2Q4YzkzZTIwZjNkMGE2ZjkwZWMxNzZk");//APISecret temp.Add("M2Q4YzkzZTIwZjNkMGE2ZjkwZWMxNzZk");//APISecret
temp.Add("828cb2dc915d28464a904bda5d7b01b3");//APIKey
break; break;
} }
case 1://百度 case 1://百度

Loading…
Cancel
Save