public void CreateFolderTest() { var root = new FtpDirectory(FTP_BASE_URL, credential); var dir = root.GetDirectory("YC.FTP"); dir.CreateSubdirectory("test"); }
public void DeleteFileTest() { var root = new FtpDirectory(FTP_BASE_URL, credential); var dir = root.GetDirectory("YC.FTP"); var file = dir.GetFile("FILE"); if (file?.Exists == true) { file.Delete(); } }
public void AppendFileTest() { var root = new FtpDirectory(FTP_BASE_URL, credential); var dir = root.GetDirectory("YC.FTP"); var file = dir.GetFile("FILE") ?? dir.CreateFile("FILE"); var stream = file.OpenAppend(); var writer = new StreamWriter(stream); writer.WriteLine("Hello World, " + DateTime.Now.ToString()); writer.WriteLine(string.Join("", Enumerable.Repeat(" ", 2048))); writer.Flush(); writer.Close(); }