Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: The value for a decimal is too big or too low C#

Please attach a full session log file (not debug log file).
Guest

The value for a decimal is too big or too low C#

Hello,
im using winscp now for a while, great library.
Suddenly, i now get an error everytime i try to sycronize my data. I posted the log as an attachment.

SessionOptions sessionOptions = new SessionOptions();
 
string host;
string username;
string pass;
string ssh;
Protocol prot;
if (getConfig("server") == "0")
{
    sessionOptions.Protocol = Protocol.Sftp;
    sessionOptions.HostName = "185.230.160.62";
    sessionOptions.UserName = "syncron";
    sessionOptions.Password = "secret";
    sessionOptions.SshHostKeyFingerprint = "ssh-rsa 2048 1BhqosNZwy6vhEGlckOG44+6UiLqr5ezaBih/m3d5/0=";
 
}
else
{
        sessionOptions.Protocol = Protocol.Ftp;
        sessionOptions.HostName = "91.132.147.185";
        sessionOptions.UserName = "syncron";
        sessionOptions.Password = "secret";
        sessionOptions.FtpMode = FtpMode.Passive;
}
 
using (Session session = new Session())
{
    session.DebugLogPath = @"C:\Users\alexa\source\repos\OutbackLifeNew\OutbackLifeNew\bin\Release\log.txt";
 
    session.FileTransferProgress += SessionFileTransferProgress;
    session.FileTransferred += FileTransferred;
 
    session.Open(sessionOptions);
    SynchronizationResult synchronizationResult;
 
    localPath = Directory.GetCurrentDirectory() + @"\mod";
 
    remotePath = "/syncron/mod";
    if (!Directory.Exists(localPath))
    {
 
        Directory.CreateDirectory(localPath);
    };
 
 
    ComparisonDifferenceCollection CompareDirectories;
 
    CompareDirectories =
    session.CompareDirectories(
        SynchronizationMode.Local, localPath, remotePath, true, false, SynchronizationCriteria.Either);
 
    synchronizationResult =
        session.SynchronizeDirectories(
            SynchronizationMode.Local, localPath,
            remotePath, true, false, SynchronizationCriteria.Either);
    synchronizationResult.Check();
}


i dont know what i should do now. it worked everytime and suddenly it doesn't. I tried really everything but nothing worked. can someone help me?