Example #1
0
        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);
        }
Example #2
0
 public void Dispose()
 {
     ftpServer?.Dispose();
 }
 public void OnetimeTeardown()
 {
     ftpServer?.Dispose();
 }
Example #4
0
 public void Dispose()
 {
     server.Stop();
     server.Dispose();
 }