Error parsing session log file and "'\b', hexadecimal value

Advertisement

Guest

Error parsing session log file and "'\b', hexadecimal value

Hi Everyone,

I need help from you guys, I thanks in advance. Actually the problem is Iam running Windows Application using C#4.0 Visual Studio 2010 on Windows7 O.S.
In this Application i have a Function Uploadto FTP()below is my function
public int UploadFiletoFTP()
{
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Sftp,
HostName = "XXXXXXXXXX",
UserName = "XXXXXXXXX",
Password = "XXXXXXXXX",
SshHostKeyFingerprint = "ssh-rsa XXXXXXXXXXX"

};

using (Session session = new Session())
{
// Connect
Common.Errlog("Connecting to the FTP.....");
session.Open(sessionOptions);
Common.Errlog("Connection to the FTP successfull....");
// Upload files
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;

TransferOperationResult transferResult;
Common.Errlog("Fetching File from file system......");
transferResult = session.PutFiles(@filepathofCSVFile + TodaysDate + ".csv", "/home/tradein/", false, transferOptions);

// Throw on any error
transferResult.Check();

// Print results
foreach (TransferEventArgs transfer in transferResult.Transfers)
{
Console.WriteLine("Upload of {0} succeeded", transfer.FileName);

}
}
}
}

Iam getting Error at session.Open(sessionOptions); In this function iam trying to upload a function a CSV file to SFTP Server.

Note: That Server is SFTP.


Thanks,
Dinesh.

Reply with quote

Advertisement

Guest

Hi Everyone,

I got solution for above mentioned problem it might help others

Username="abcd/host" ---------- its not allowing "/h"
and giving the below error
"'\h', hexadecimal value 0x08, is an invalid character. Line 2, position 65."

Now i Resolved it like below
Username=@"abcd/host"------here i added @

Thanks,
Dinesh.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Error parsing session log file and "'\b', hexadecimal value

Please set Session.DebugLogPath and attach (or email me) the log.

Reply with quote

Advertisement

You can post new topics in this forum