hello, I have such a situation in the document definition, I recognize 10 documents and for each document a script is registered that writes the data to a text document and sends it to the FTP server, respectively, each script opens a session on the server when it starts, where the maximum number is 8 open.After recording, you will see that I am sending through WebClient, as I read that it closes the session behind itself, and if it didn’t close then client.Dispose(); helps it close but still i get the same error after export to server 421.I ask for your help how to do it right or fix this script.
Regards Vladimer
using System;
using System.Net;
using System.IO;
using System.Threading;
string a = Document.Field("CMR\\Service Field").Text;
int index = a.LastIndexOf(".");
a = a.Substring(0, index);
if (a.Contains("/"))
{
index = a.LastIndexOf("/");
}
else
{
index = a.LastIndexOf(@"\");
}
a = a.Substring(index + 1);
string localFilePath = @"C:\ABBYY Training\ScriptedExport\" + a + ".txt";
using (StreamWriter file = new StreamWriter(localFilePath))
{
file.Write("ZeptosEncoding#");
file.Write("ტვირთის მიმღები კომპანია:" + Document.Field("CMR\\Import_Comapny_Name").Value);
file.Write("ZeptosEncoding#");
}
WebClient client = new WebClient();
client.Credentials = new NetworkCredential("user", "password");
string remoteFilePath = "ftp://*****/output/" + a + ".txt";
client.UploadFile(remoteFilePath, localFilePath);
client.Dispose();
コメント
0件のコメント
サインインしてコメントを残してください。