FTP Удаленный сервер вернул ошибку: (530) не вошел в системуC#

Место общения программистов C#
Anonymous
FTP Удаленный сервер вернул ошибку: (530) не вошел в систему

Сообщение Anonymous »

Я создал FTP, и я хочу прочитать некоторые данные, используя C# код. Когда FTP не имеет доступа к имени пользователя/пароля, все работает отлично. Но когда я вкладываю имя пользователя и пароль, я получаю удаленный сервер возвращал ошибку: (530) не введено в систему .
Я попробовал все вопросы по переполнению стека и в Интернете, как это ошибка.

Код: Выделить всё

foreach (string fileNameInFTP in directories)
{
//                string fileNameInFTP2 = Path.GetFileNameWithoutExtension(fileNameInFTP);
if ((!haveWeAlreadyParsedThisFile(fileNameInFTP)) && (fileNameInFTP.Contains("CustsExport")) && (!fileNameInFTP.EndsWith("Empty.xml")) && (!fileNameInFTP.Contains("DelCustsExport")))
{
string file = FTPAddress + "/" + fileNameInFTP;
Console.WriteLine(file);
List customersList =
(
from e in XDocument.Load(file).Root.Elements("cust")
select new Customer
{
MemeberID = (int)e.Attribute("memberid"),
CustomerID = (int)e.Attribute("custid"),
FirstName = (string)e.Attribute("fname"),
LastName = (string)e.Attribute("lname"),
ShowsNumber = (int)e.Attribute("count_noshow"),
VisitNumber = (int)e.Attribute("count_resos"),
Cancellation = (int)e.Attribute("count_cancel"),
MobileNumber = (string)e.Element("phone").Attribute("phonenumber")
/*Projects =
(
from p in e.Elements("projects").Elements("project")
select new Project
{
ProjectCode = (string)p.Element("code"),
ProjectBudget = (int)p.Element("budget")
}).ToArray()*/
}).ToList();
< /code>
 Примечание: < /h3> Я могу получить доступ к FTP, потому что переменная `Directory` - это список файлов в FTP, и когда я отлаживаю код, я вижу, что она имеет ** файлы, но исключение в этой строке:
                    List customersList =
(
from e in XDocument.Load(file).Root.Elements("cust")
select new Customer
{
MemeberID = (int)e.Attribute("memberid"),
CustomerID = (int)e.Attribute("custid"),
FirstName = (string)e.Attribute("fname"),
LastName = (string)e.Attribute("lname"),
ShowsNumber = (int)e.Attribute("count_noshow"),
VisitNumber = (int)e.Attribute("count_resos"),
Cancellation = (int)e.Attribute("count_cancel"),
MobileNumber = (string)e.Element("phone").Attribute("phonenumber")
/*Projects =
(
from p in e.Elements("projects").Elements("project")
select new Project
{
ProjectCode = (string)p.Element("code"),
ProjectBudget = (int)p.Element("budget")
}).ToArray()*/
}).ToList();
Другими словами: я могу читать имена файлов, но не их содержание.

Подробнее здесь: https://stackoverflow.com/questions/276 ... -logged-in

Вернуться в «C#»