using ftpWebRequest with an error: the remote server returned error 530 not logged in

久未见 提交于 2019-11-29 10:35:55

Shouldn't the line:

request.Credentials = new NetworkCredential("dev\ftp", "devftp");

be:

request.Credentials = new NetworkCredential("dev\\ftp", "devftp");

or:

request.Credentials = new NetworkCredential(@"dev\ftp", "devftp");

I have to believe this may be causing your issues because the \f is a form feed character.

Godwin

Faced the same issue, here's my solution:

request.Credentials = new NetworkCredential(
    usernameVariable.Normalize(),passwordVariable.Normalize(),domainVariable.Normalize());

Details can be found here

Hope it helps.

I found out that when connecting via .NET/C# to a FTP-server some characters are not "valid". After setting the login credentials to only only letters and numbers [a-Z0-9] it worked to log in.

Just remove the double quote from username or password because sometimes $ sign in username or password causes problem. Its good to use single quote every time.

If you assume anonymous logon do not set network credentials. this was the root of my problems.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!