|
这是x64版本,
这个fineftp主要部分就是个lib,原作者就没做界面,
只有main.cpp里面有如下内容写的配置,
一个根目录local_root,默认匿名用户Anonymous有全部权限,
再给了Uploader用户具有读写权限,MyUser用户只读权限,
这些都是直接写在代码里面的,所以要求使用者要会一点编程,
原作者没有提供配置文件来保存这些
- #ifdef WIN32
- std::string local_root;
- local_root = "C:\"; // The backslash at the end is necessary!
- std::cout << "local_root: " << local_root << std::endl;
- #else // WIN32
- const std::string local_root = "/";
- #endif // WIN32
- // Create an FTP Server on port 2121. We use 2121 instead of the default port
- // 21, as your application would need root privileges to open port 21.
- fineftp::FtpServer server(2121);
- // Add the well known anonymous user and some normal users. The anonymous user
- // can log in with username "anonyous" or "ftp" and any password. The normal
- // users have to provide their username and password.
- server.addUserAnonymous(local_root, fineftp::Permission::All);
- server.addUser ("MyUser", "MyPassword", local_root, fineftp::Permission::ReadOnly);
- server.addUser ("Uploader", "123456", local_root, fineftp::Permission::DirList | fineftp::Permission::DirCreate | fineftp::Permission::FileWrite | fineftp::Permission::FileAppend);
- // Start the FTP server with 4 threads. More threads will increase the
- // performance with multiple clients, but don't over-do it.
- server.start(4);
复制代码
|
评分
-
查看全部评分
|