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

Author Message
Guest




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.
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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Please set Session.DebugLogPath and attach (or email me) the log.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License