在Wince中使用用户帐户(用户创建)实现FTP

时间:2011-01-31 08:19:16

标签: c++ ftp windows-ce

操作系统:WinCE 6.0 R3 Platform Builder:PB6

我正在尝试在wince中为FTP创建用户。我正在使用NTLMSetUserInfo()来创建用户。

它在注册表中创建USER条目。但是当尝试使用该用户和密码登录时,它不允许登录.. BAD USER和PASSWORD。

我的注册表设置是:

[HKEY_LOCAL_MACHINE\Ident]
"OrigName"="Kunu"
"Name"="My Device"
"Desc"=LOC_DEFAULTDEVICEDESC


[HKEY_LOCAL_MACHINE\COMM\FTPD]
"IsEnabled"=dword:1
"UseAuthentication"=dword:1
"UserList"="krunal"
"AllowAnonymous"=dword:0
"AllowAnonymousUpload"=dword:0
"AllowAnonymousVroots"=dword:0
"DefaultDir"="\\Windows"
; Idle time (in seconds) after which the connection is automatically closed. 
Default = 5 mins
"IdleTimeout"=dword:12c
;To control logging
"DebugOutputChannels"=dword:2
"DebugOutputMask"=dword:17
"BaseDir"="\\"
"LogSize"=dword:1000

[HKEY_LOCAL_MACHINE\Services\Smbserver]
"AdapterList"="*"
[HKEY_LOCAL_MACHINE\Services\Smbserver\Shares\Root]
"Path"="\\temp"
"Type"=dword:0
"UserList"="admin"



[HKEY_LOCAL_MACHINE\Services\SMBServer\Shares\VirtualRoot]
    "Type"=dword:0
    "Path"="\\Windows"
    "UserList"="krunal"

[HKEY_LOCAL_MACHINE\Drivers\Service\SMBServer]
     "AdapterList"="*"

[HKEY_LOCAL_MACHINE\Comm\Redir]
"DefaultDomain"=""

[HKEY_LOCAL_MACHINE\Services\SMBServer\Shares]
     "UseAuthentication"=dword:1

NTLMSetUserInfo()之后的注册表项

HKEY_LOCAL_MACHINE\Comm\Security\UserAccounts\Mike

在此之下,我将提供主页和权限注册表值以供访问。

仍然不起作用..

我甚至使用API​​ AuthHelpInitialize()AuthHelpValidateUserW()来验证用户。

它返回用户未出现失败的情况..

我如何创建用户并给予他们特定的目录访问权限...... ???

先谢谢, Krunal Soni。

1 个答案:

答案 0 :(得分:0)

我相信您仍然必须拥有FTPD注册表项中UserList值的用户。尝试在调用NTLMSetUserInfo后在其中附加用户名。您可能(不确定)也必须停止并重新启动该服务。

相关问题