WinCE5.0下设置FTP(一)
来源:互联网 发布:阿里云人才市场 编辑:程序博客网 时间:2024/05/23 11:54
沈阳的客户要求我们提供的系统具有FTP功能,并可设置用户和密码,下面粗略的写一下设置过程:
首先要将FTP组件加到系统中来,这是开展下一步工作的基础,接下来修改platform.reg文件,添加如下信息:
[HKEY_LOCAL_MACHINE/COMM/FTPD]
"AllowAnonymous"=dword:0 ;Determines whether the server will allow anonymous access.
"AllowAnonymousUpload"=dword:1 ;Determines whether authorization is required to upload files to the server, delete files from the server, and rename files.
"AllowAnonymousVroots"=dword:1 ;Specifies whether access to virtual roots is granted or denied to anonymous users.
"DefaultDir"="//Hard Disk//FtpRoot" ;Default root directory. Directory and subdirectories of this key are accessible remotely. If this value is not set in the registry, the default is /Temp.
"IsEnabled"=dword:1 ;Determines whether or not the server will accept incoming connections. This value is typically used to keep the server disabled at boot time.
"UseAuthentication"=dword:1 ;Determines whether authorization is required to connect to the server. Determines whether the client needs to send a USER and PASS pair before being allowed to issue other commands.
"UserList"=""
上面的各项注释写得很清楚,关于此处的设置,MSDN地址为:http://msdn2.microsoft.com/en-us/library/ms901310.aspx
编译好的NK运行后还不能通过FTP进行访问,因为我们还没有给FTP Server添加用户,添加用户有点麻烦,要自己写些代码,部分代码如下:
typedef BOOL ( *PFnSetUser )(IN LPCTSTR pszUser, IN LPCTSTR pszPassword);
hDllModule = LoadLibrary( _T("ntlmssp.dll") );
if (NULL == hDllModule)
{
return FALSE;
}
PFnSetUser pFnSetUser = (PFnSetUser)GetProcAddress(hDllModule, _T("NTLMSetUserInfo"));
if(!pFnSetUser)
{
return FALSE;
}
return pFnSetUser( szName, szPwd );
通过上面的代码,我们就可以为系统添加用户,通过远程工具,我们可以在系统注册表中看到已经加载的用户. 具体位置:HKEY_LOCAL_MACHINE/Comm/Security/UserAccounts.
不过只加了系统用户还不行,因为还没有给这个用户访问FTP的权限,我们前 面在platform.reg中设置FTP参数时最后有一项是UserList, 对了,这里就是添加FTP用户的地方,可以参考前面给出的MSDN地址中关于此处的设置,多个用户之前要用分号(;)隔开, 如:
"UserList"="User1;User2"
至此你会发现我们终于可以用添加的用户名登陆FTP服务器了.通过以上操作,FTP Server的基本功能就设置完了.
- WinCE5.0下设置FTP(一)
- WinCE5.0下设置FTP(二)
- WINCE5.0下开发winform应用程序一
- wince5.0 下中英文
- wince5.0 模拟器设置连接
- 一、wince5.0开发概述
- VS2005与WINCE5.0模拟器连接设置
- ubuntu下设置FTP
- 如何在WINCE5.0下显示图片
- 如何在WINCE5.0下显示图片
- wince5.0 在xp64下安装
- wince5.0下Camera驱动程序分析
- wince5.0下S3C2412SD卡驱动分析
- wince5.0下Camera驱动程序分析
- wince5.0 Eboot下USB中断机制
- WinCE5.0下触摸屏的校准
- wince5.0下Camera驱动程序分析
- wince5.0下Camera驱动程序分析
- 男人必进(女生就不要进了)
- 无废话C#设计模式之三:Abstract Factory
- 从内存中加载Pe文件: 免费使用SkinMagic,SkinCrafter和Skin++(SkinPP)
- Oracle] UNIX与Windows 2000上Oracle的差异(II)
- [Oracle] UNIX与Windows 2000上Oracle的差异(III)
- WinCE5.0下设置FTP(一)
- Longest common substring
- 数据丢失后
- java面试常见问题
- 用VC获取其它程序的命令行参数
- 阿蒙:金山苦命,百度好命
- spring jpetstore研究
- SQL Server的Identity字段使用/复制/重设(转)
- 中国大学毕业生薪水排行榜最新版