|
|
|
@ -1,119 +1,112 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
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 txtPath = Directory.GetCurrentDirectory() + "\\translationResource\\ListPrivate.txt";
|
|
|
|
|
|
|
|
|
|
private String getTranslationPrivateApi(StreamReader sr)
|
|
|
|
|
{
|
|
|
|
|
private static string path = Directory.GetCurrentDirectory() + "\\translationResource";
|
|
|
|
|
private static string txtPath = Directory.GetCurrentDirectory() + "\\translationResource\\ListPrivate.txt";
|
|
|
|
|
String temp = sr.ReadLine();
|
|
|
|
|
|
|
|
|
|
public bool GetExistsD()
|
|
|
|
|
if (temp != null)
|
|
|
|
|
{
|
|
|
|
|
return Directory.Exists(path);
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool GetExistsF(string name)
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return Directory.Exists(txtPath + "\\" + name + ".txt");
|
|
|
|
|
return "ERROR";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String getTranslationPrivateKey(StreamReader sr)
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
String temp = sr.ReadLine();
|
|
|
|
|
return "ERROR";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (temp != null)
|
|
|
|
|
{
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return "ERROR";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
public string getpath(string id)
|
|
|
|
|
{
|
|
|
|
|
return path + "\\" + id + ".txt";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string getpath(string id)
|
|
|
|
|
{
|
|
|
|
|
return path + "\\" + id + ".txt";
|
|
|
|
|
}
|
|
|
|
|
public string gettxt()
|
|
|
|
|
{
|
|
|
|
|
return txtPath;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<string> OutputTranslationS(string id)
|
|
|
|
|
{
|
|
|
|
|
string temppath = path + "\\" + id + ".txt";
|
|
|
|
|
|
|
|
|
|
List<string> temp = new List<string> { };
|
|
|
|
|
|
|
|
|
|
public string gettxt()
|
|
|
|
|
if (Directory.Exists(temppath))//若不存在
|
|
|
|
|
{
|
|
|
|
|
return txtPath;
|
|
|
|
|
temp.Add("尚未输入!!!");
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<string> OutputTranslationS(string id)
|
|
|
|
|
{
|
|
|
|
|
string temppath = path + "\\" + id + ".txt";
|
|
|
|
|
|
|
|
|
|
List<string> temp = new List<string> { };
|
|
|
|
|
|
|
|
|
|
if (Directory.Exists(temppath))//若不存在
|
|
|
|
|
{
|
|
|
|
|
temp.Add(temppath);
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StreamReader sr = new StreamReader(temppath);
|
|
|
|
|
string temp2 = sr.ReadLine();
|
|
|
|
|
while(temp2 != null && temp2 != "")
|
|
|
|
|
{
|
|
|
|
|
temp.Add(temp2);
|
|
|
|
|
temp2 = sr.ReadLine();
|
|
|
|
|
}
|
|
|
|
|
StreamReader sr = new StreamReader(temppath);
|
|
|
|
|
|
|
|
|
|
sr.Close();
|
|
|
|
|
|
|
|
|
|
temp.Add(this.getTranslationPrivateApi(sr));
|
|
|
|
|
temp.Add(this.getTranslationPrivateKey(sr));
|
|
|
|
|
|
|
|
|
|
sr.Close();
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<string> OutputTranslationNameList()
|
|
|
|
|
{
|
|
|
|
|
List<string> temp = new List<string> { };
|
|
|
|
|
string temptxtpath = txtPath;
|
|
|
|
|
|
|
|
|
|
if (Directory.Exists(temptxtpath))
|
|
|
|
|
{
|
|
|
|
|
temp.Add("ERROR");
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public List<string> OutputTranslationNameList()
|
|
|
|
|
{
|
|
|
|
|
List<string> temp = new List<string> { };
|
|
|
|
|
string temptxtpath = txtPath;
|
|
|
|
|
|
|
|
|
|
if(Directory.Exists(temptxtpath))
|
|
|
|
|
{
|
|
|
|
|
temp.Add("ERROR1");
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
StreamReader sr = new StreamReader(temptxtpath);
|
|
|
|
|
string temp2 = sr.ReadLine();
|
|
|
|
|
if (temp2 == null)
|
|
|
|
|
{
|
|
|
|
|
temp.Add("ERROR2");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
StreamReader sr = new StreamReader(temptxtpath);
|
|
|
|
|
string temp2 = sr.ReadLine();
|
|
|
|
|
if (temp2 == null)
|
|
|
|
|
{
|
|
|
|
|
temp.Add("ERROR");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
while (temp2 != null)
|
|
|
|
|
{
|
|
|
|
|
while (temp2 != null)
|
|
|
|
|
{
|
|
|
|
|
temp.Add(temp2);
|
|
|
|
|
temp2 = sr.ReadLine();
|
|
|
|
|
}
|
|
|
|
|
temp.Add(temp2);
|
|
|
|
|
temp2 = sr.ReadLine();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sr.Close();
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sr.Close();
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
class customTransApi
|
|
|
|
|
{
|
|
|
|
|
private string ID { get; set; }
|
|
|
|
|
private string KEY { get; set; }
|
|
|
|
|
private string SECRET { get; set; }
|
|
|
|
|
|
|
|
|
|
}
|