本文整理汇总了C#中SftpClient.RenameFile方法的典型用法代码示例。如果您正苦于以下问题:C# SftpClient.RenameFile方法的具体用法?C# SftpClient.RenameFile怎么用?C# SftpClient.RenameFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SftpClient
的用法示例。
在下文中一共展示了SftpClient.RenameFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test_Sftp_Rename_File
public void Test_Sftp_Rename_File()
{
using (var sftp = new SftpClient(Resources.HOST, Resources.USERNAME, Resources.PASSWORD))
{
sftp.Connect();
string uploadedFileName = Path.GetTempFileName();
string remoteFileName1 = Path.GetRandomFileName();
string remoteFileName2 = Path.GetRandomFileName();
this.CreateTestFile(uploadedFileName, 1);
using (var file = File.OpenRead(uploadedFileName))
{
sftp.UploadFile(file, remoteFileName1);
}
sftp.RenameFile(remoteFileName1, remoteFileName2);
File.Delete(uploadedFileName);
sftp.Disconnect();
}
RemoveAllFiles();
}
示例2: Test_Sftp_RenameFile_Null
public void Test_Sftp_RenameFile_Null()
{
using (var sftp = new SftpClient(Resources.HOST, Resources.USERNAME, Resources.PASSWORD))
{
sftp.Connect();
sftp.RenameFile(null, null);
sftp.Disconnect();
}
}
示例3: RenameFileTest1
public void RenameFileTest1()
{
ConnectionInfo connectionInfo = null; // TODO: Initialize to an appropriate value
SftpClient target = new SftpClient(connectionInfo); // TODO: Initialize to an appropriate value
string oldPath = string.Empty; // TODO: Initialize to an appropriate value
string newPath = string.Empty; // TODO: Initialize to an appropriate value
bool isPosix = false; // TODO: Initialize to an appropriate value
target.RenameFile(oldPath, newPath, isPosix);
Assert.Inconclusive("A method that does not return a value cannot be verified.");
}