Re: The value for a decimal is too big or too low C#
Please attach a full session log file (not debug log file).
Before posting, please read how to report bug or request support effectively.
Bug reports without an attached log file are usually useless.
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();
}