Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string getCheckSum(string fileName)
- {
- SessionOptions sessionOptions = new SessionOptions
- {
- Protocol = Protocol.Ftp,
- HostName = this.endpointBaseUriString,
- UserName = this.userName,
- Password = this.password,
- FtpMode = FtpMode.Passive
- };
- string result = null;
- try
- {
- using (Session session = new Session())
- {
- session.Open(sessionOptions);
- var command = $"XMD5 '{fileName}' SP EP ;";
- var transferResult = session.ExecuteCommand(command);
- transferResult.Check();
- result = transferResult.Output;
- //var transferResult = session.CalculateFileChecksum("md5", fileName);
- }
- }
- catch (Exception ex) {
- throw ex;
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement