Renci.SshNet.Sftp.SftpFile.Delete C# (CSharp) Méthode

Delete() public méthode

Permanently deletes a file on remote machine.
public Delete ( ) : void
Résultat void
        public void Delete()
        {
            if (IsDirectory)
            {
                _sftpSession.RequestRmDir(FullName);
            }
            else
            {
                _sftpSession.RequestRemove(FullName);
            }
        }

Usage Example

Exemple #1
0
 public void DeleteTest()
 {
     SftpSession sftpSession = null; // TODO: Initialize to an appropriate value
     string fullName = string.Empty; // TODO: Initialize to an appropriate value
     SftpFileAttributes attributes = null; // TODO: Initialize to an appropriate value
     SftpFile target = new SftpFile(sftpSession, fullName, attributes); // TODO: Initialize to an appropriate value
     target.Delete();
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }