Skip to content

Commit

Permalink
Yet another fix for configs.
Browse files Browse the repository at this point in the history
  • Loading branch information
UlyssesWu committed Mar 22, 2016
1 parent 55352a9 commit 2c6425c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions UniFTP.Server/FtpServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
6 changes: 3 additions & 3 deletions UniFTPServerConsole/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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!");
Expand Down

0 comments on commit 2c6425c

Please sign in to comment.