示例#1
0
        protected override void OnStart(string[] args)
        {
            AddLog(String.Format("BitMobile FTP service started. Start listening on port {0}", port.ToString()));
            try
            {
                String[] arguments = Environment.GetCommandLineArgs();

                if (arguments.Length != 2)
                {
                    throw new Exception(@"Web.config file should be provided as an argument. Modify registry entry ImagePath at HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\BitMobile FTP Service");
                }

                Dictionary <String, String> settings = ReadSettings(arguments[1]);
                Common.Solution.InitContext(settings["DataBaseServer"], settings["SolutionsFolder"], settings["BitMobileServerId"], false, settings["RootPassword"]);

                String solutionFolder          = settings["SolutionsFolder"];
                FtpService.FtpServer ftpServer = new FtpService.FtpServer(settings["SolutionsFolder"], port);

                ftpServer.Start();
            }
            catch (Exception e)
            {
                AddLog(e.Message, EventLogEntryType.Error);
                throw;
            }
        }
示例#2
0
        private String StartFtpServer(System.Collections.Specialized.NameValueCollection parameters)
        {
            String root = Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetLocalResource("Storage").RootPath;

            //InitContext

            String[] solutions = parameters["solutions"].Split(';');
            foreach (String s in solutions)
            {
                String solutionFolder = String.Format(@"{0}\{1}", root, s);
                if (!System.IO.Directory.Exists(solutionFolder))
                    System.IO.Directory.CreateDirectory(solutionFolder);
            }

            FtpService.FtpServer ftpServer = new FtpService.FtpServer(root, 21);
            ftpServer.Start();

            return "ok";
        }
示例#3
0
        private String StartFtpServer(System.Collections.Specialized.NameValueCollection parameters)
        {
            String root = Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetLocalResource("Storage").RootPath;

            //InitContext

            String[] solutions = parameters["solutions"].Split(';');
            foreach (String s in solutions)
            {
                String solutionFolder = String.Format(@"{0}\{1}", root, s);
                if (!System.IO.Directory.Exists(solutionFolder))
                {
                    System.IO.Directory.CreateDirectory(solutionFolder);
                }
            }

            FtpService.FtpServer ftpServer = new FtpService.FtpServer(root, 21);
            ftpServer.Start();

            return("ok");
        }
示例#4
0
        static void Main(string[] args)
        {
            try
            {
                if (args.Length != 1)
                    throw new Exception(@"Web.config file should be provided as an argument.");

                Dictionary<String, String> settings = ReadSettings(args[0]);

                Common.Solution.InitContext(settings["DataBaseServer"], settings["SolutionsFolder"], settings["BitMobileServerId"], false, settings["RootPassword"]);

                FtpService.FtpServer ftpServer = new FtpService.FtpServer(settings["SolutionsFolder"], port);
                ftpServer.Start();
                Console.WriteLine(String.Format("BitMobile FTP server started. Start listening on port {0}", port.ToString()));
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
示例#5
0
        static void Main(string[] args)
        {
            try
            {
                if (args.Length != 1)
                {
                    throw new Exception(@"Web.config file should be provided as an argument.");
                }

                Dictionary <String, String> settings = ReadSettings(args[0]);

                Common.Solution.InitContext(settings["DataBaseServer"], settings["SolutionsFolder"], settings["BitMobileServerId"], false, settings["RootPassword"]);

                FtpService.FtpServer ftpServer = new FtpService.FtpServer(settings["SolutionsFolder"], port);
                ftpServer.Start();
                Console.WriteLine(String.Format("BitMobile FTP server started. Start listening on port {0}", port.ToString()));
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
示例#6
0
        protected override void OnStart(string[] args)
        {
            AddLog(String.Format("BitMobile FTP service started. Start listening on port {0}", port.ToString()));
            try
            {
                String[] arguments = Environment.GetCommandLineArgs();

                if (arguments.Length != 2)
                    throw new Exception(@"Web.config file should be provided as an argument. Modify registry entry ImagePath at HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\BitMobile FTP Service");

                Dictionary<String, String> settings = ReadSettings(arguments[1]);
                Common.Solution.InitContext(settings["DataBaseServer"], settings["SolutionsFolder"], settings["BitMobileServerId"], false, settings["RootPassword"]);

                String solutionFolder = settings["SolutionsFolder"];
                FtpService.FtpServer ftpServer = new FtpService.FtpServer(settings["SolutionsFolder"], port);

                ftpServer.Start();
            }
            catch (Exception e)
            {
                AddLog(e.Message, EventLogEntryType.Error);
                throw;
            }
        }
示例#7
0
 private void Execute()
 {
     FtpService.FtpServer ftpServer = new FtpService.FtpServer(solutionFolder, port);
     ftpServer.PassiveAddress = passiveAddress;
     ftpServer.Start();
 }
示例#8
0
 private static void CreateFtpEndPoint(String solutionFolder)
 {
     FtpService.FtpServer ftpServer = new FtpService.FtpServer(solutionFolder, 21);
     ftpServer.Start();
 }
示例#9
0
 private void Execute()
 {
     FtpService.FtpServer ftpServer = new FtpService.FtpServer(solutionFolder, port);
     ftpServer.PassiveAddress = passiveAddress;
     ftpServer.Start();
 }
示例#10
0
 private static void CreateFtpEndPoint(String solutionFolder)
 {
     FtpService.FtpServer ftpServer = new FtpService.FtpServer(solutionFolder, 21);
     ftpServer.Start();
 }