public bool Start(string rootDir, string ipserver) { if (_HasInit) { Console.WriteLine("FtpServer already start"); return(true); } ipself = ipserver; if (!Directory.Exists(rootDir)) { Directory.CreateDirectory(rootDir); } fsProvider = new DotNetFileSystemProvider(rootDir); if (_FtpServer != null) { _FtpThreadAutoResetEvent.Reset(); _FtpServer.Stop(); _FtpServer.Dispose(); } _FtpThread = new Thread(new ThreadStart(DoStart)); _FtpThread.Start(); return(true); }
public void Dispose() { ftpServer?.Dispose(); }
public void OnetimeTeardown() { ftpServer?.Dispose(); }
public void Dispose() { server.Stop(); server.Dispose(); }