Connection failed on session.Open method

Advertisement

megha
Joined:
Posts:
1

Connection failed on session.Open method

Connection failed at WinSCP.SessionLogReader.Read(LogReadFlags flags)
at WinSCP.ElementLogReader.Read(LogReadFlags flags)
at WinSCP.SessionElementLogReader.Read(LogReadFlags flags)
at WinSCP.CustomLogReader.TryWaitForNonEmptyElement(String localName, LogReadFlags flags)
at WinSCP.CustomLogReader.WaitForNonEmptyElement(String localName, LogReadFlags flags)
at WinSCP.Session.WaitForGroup()
at WinSCP.Session.Open(SessionOptions sessionOptions)
at WebApplication1.WinSCP.btnCheck_Click(Object sender, EventArgs e)

Code:
I am using anonymous access to my ftp. and i created ftp locally. So what password and username i give ? Whatever i give its failing
// Setup session options
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Ftp,
HostName = "ftp://sringeri/",
UserName = "", // what should i give?
Password = "" //what should i give ?
};

const string remotePath = "ftp://sringeri/";

using (Session session = new Session())
{
// Connect
session.Open(sessionOptions); // here it exists

}

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum