From 2c6425c4ac8c3b18ddf51c7a3ee72e2d6e9577d8 Mon Sep 17 00:00:00 2001 From: Ulysses Wu Date: Tue, 22 Mar 2016 17:17:42 +0800 Subject: [PATCH] Yet another fix for configs. --- UniFTP.Server/FtpServer.cs | 4 ++++ UniFTPServerConsole/Program.cs | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/UniFTP.Server/FtpServer.cs b/UniFTP.Server/FtpServer.cs index f5ecbd1..c55113f 100644 --- a/UniFTP.Server/FtpServer.cs +++ b/UniFTP.Server/FtpServer.cs @@ -401,6 +401,10 @@ public FtpServer(IPEndPoint[] localEndPoints, string logHeader = "UniFTP") private void InitServer(string logHeader) { + if (_config == null) + { + _config = new FtpConfig(); + } if (File.Exists("UniFTP.Server.log4net")) { log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo("UniFTP.Server.log4net")); diff --git a/UniFTPServerConsole/Program.cs b/UniFTPServerConsole/Program.cs index 759b3ac..71886a4 100644 --- a/UniFTPServerConsole/Program.cs +++ b/UniFTPServerConsole/Program.cs @@ -7,7 +7,7 @@ class Program { static void Main(string[] args) { - FtpServer f = new FtpServer(port:21,enableIPv6:true,logHeader:"UniFTP"); + FtpServer f = new FtpServer(port:21,enableIPv6:true, ipv6Port:2121, logHeader:"UniFTP"); f.Config = new FtpConfig( "D:\\Temp",welcome:new string[]{"By Ulysses"}); //如果有配置文件则可以读取 f.LoadConfigs(); @@ -22,8 +22,8 @@ static void Main(string[] args) //f.AddGroupRule("test", "/", "rwxrwxrwx"); //f.AddUser("root", "test", "test"); //添加链接 - f.AddLink("test", "M:\\Clannad", "/"); - f.AddGroupRule("test", "/Clannad", "r-xr-xr-x"); + f.AddLink("test", "M:\\ACGMusic", "/"); + f.AddGroupRule("test", "/Music", "r-xr-xr-x"); f.Start(); Console.WriteLine("UniFTP Server Started!");