|
@@ -13,6 +13,7 @@ using System.Net.Http;
|
|
|
using System.Text;
|
|
|
using System.Text.RegularExpressions;
|
|
|
using System.Threading.Tasks;
|
|
|
+using System.Web;
|
|
|
using static Dropbox.Api.Files.SearchMatchType;
|
|
|
using static Dropbox.Api.TeamLog.EventCategory;
|
|
|
|
|
@@ -234,23 +235,13 @@ namespace PDF_Master.Helper
|
|
|
//return jobject["code"].ToObject<string>().ToLower();
|
|
|
using (var client = new WebClient())
|
|
|
{
|
|
|
- string folderPath = Path.Combine(App.CurrentPath, "DownloadFile");
|
|
|
- //有可能因为其他原因存在同名文件,导致创建文件夹失败,需要先删除同名文件
|
|
|
- if (File.Exists(folderPath))
|
|
|
- {
|
|
|
- File.Delete(folderPath);
|
|
|
- }
|
|
|
- DirectoryInfo tempfolder = new DirectoryInfo(folderPath);
|
|
|
- if (!tempfolder.Exists)
|
|
|
- {
|
|
|
- tempfolder.Create();
|
|
|
- }
|
|
|
+ string folderPath = file.FullName.Remove(file.FullName.LastIndexOf("."), file.FullName.Length- file.FullName.LastIndexOf(".")) + "_aiTranslation.pdf"; ;
|
|
|
client.DownloadProgressChanged += (sender, e) =>
|
|
|
{
|
|
|
|
|
|
};
|
|
|
- client.DownloadFile(translate, folderPath + "\\" + file.Name.Replace(file.Extension,".pdf"));
|
|
|
- return folderPath + "\\" + file.Name.Replace(file.Extension, ".pdf");
|
|
|
+ client.DownloadFile(translate, folderPath);
|
|
|
+ return folderPath;
|
|
|
}
|
|
|
//return "200";
|
|
|
}
|