public void TestAllocateStorage(string host, int port, FtpSecurityProtocol protocol, string user, string pwd, string server) { using (FtpClient c = new FtpClient(host, port, protocol)) { c.AlwaysAcceptServerCertificate = true; c.Open(user, pwd); Assert.IsTrue(c.IsConnected); c.AllocateStorage(1024 * 16); } }
internal void GetDiskFreeSpace(long testSize, ref ulong freeBytesAvailable, ref ulong totalBytes, ref ulong totalFreeBytes) { lock (commandLock) { CheckConnected(); ftpInstance.AllocateStorage(testSize); foreach (string[] values in from response in ftpInstance.LastResponseList where response.IsInformational select response.Text.Split('[', ']') into values where values.Length == 7 select values) { ulong.TryParse(values[1].Trim(), out freeBytesAvailable); ulong.TryParse(values[3].Trim(), out totalBytes); ulong.TryParse(values[5].Trim(), out totalFreeBytes); break; } } }