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; } }
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"; }
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"); }
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); } }
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); } }
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; } }
private void Execute() { FtpService.FtpServer ftpServer = new FtpService.FtpServer(solutionFolder, port); ftpServer.PassiveAddress = passiveAddress; ftpServer.Start(); }
private static void CreateFtpEndPoint(String solutionFolder) { FtpService.FtpServer ftpServer = new FtpService.FtpServer(solutionFolder, 21); ftpServer.Start(); }