WNetAddConnection2似乎缓存了密码

编程入门 行业动态 更新时间:2024-10-21 19:38:23
本文介绍了WNetAddConnection2似乎缓存了密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们正在开发Windows桌面应用程序(Windows窗体)。其中一项功能是从UI映射webDAV驱动器。 $ 我们使用生活在mpr.dll中的Windows Networking API。 当我们尝试使用 WNetAddConnection2 方法连接WebDAV共享并且用户提供了无效密码时,我们会收到 NotAuthenticated(1244)结果。 现在出现问题:如果在(秒)之后不久提供了正确的密码,首次尝试我们 仍然得到NotAuthenticated错误。等待大约30秒然后重试导致成功登录。此问题 仅在Windows 7和10 (版本1709; Build 16299.64)下发生。 我已发布关于StackOverflow的问题,但没有得到任何答案。 如需代码示例,请在此处查看我的问题: stackoverflow/questions/47714395/windows-networking-wnet-api-mpr-dll-wnetaddconnection2-fails -with-notauthent 我可以做些什么来"短时间缓存无效密码"离开? $ 亲切的问候, Christian

Hi, we are developing a Windows Desktop Application (Windows Forms). One of the features is to map a webDAV drive from the UI. We use the Windows Networking API that lives in the mpr.dll. When we try to connect a WebDAV share using the WNetAddConnection2 method and an invalid password is provided by the user, we receive an NotAuthenticated (1244) result. Now here is the problem: When a correct password is provided shortly after (seconds)the first attempt we still get the NotAuthenticated error. Waiting for around 30 seconds and then retrying results in a successful login. This problem only occurs under Windows 7 and 10 (Version 1709; Build 16299.64). I have already posted a question on StackOverflow but did not get any answers. For a code example please see my Question here: stackoverflow/questions/47714395/windows-networking-wnet-api-mpr-dll-wnetaddconnection2-fails-with-notauthent What can I do to make this "caching of invalid password for a short time" go away? Kind regards, Christian

推荐答案

嗨Christian,

Hi Christian,

感谢您在此发帖。

>>我可以做些什么来"短时间缓存无效密码"离开?

如果你想缓存无效密码,你是否尝试使用网络中的 CONNECT_TEMPORARY 标志不应记住资源连接。如果设置了此标志,则当用户再次登录时,操作系统将不会尝试恢复连接。

If you want to cache the invalid password, did you try to use the CONNECT_TEMPORARY flag, which the network resource connection should not be remembered. If this flag is set, the operating system will not attempt to restore the connection when the user logs on again.

根据错误消息,由于用户未执行请求的操作未经过身份验证。

According to the error message, The operation being requested was not performed because the user has not been authenticated.

您可能需要 CONNECT_CRED_RESET 或 CONNECT_CMD_SAVECRED 标记。

Maybe you need CONNECT_CRED_RESET or CONNECT_CMD_SAVECRED flag.

如果设置了此标志,并且操作系统提示输入凭据,则凭证管理器应保存凭据。如果为呼叫者的登录会话禁用了凭据管理器,或者网络提供商不支持保存凭据,

If this flag is set, and the operating system prompts for a credential, the credential should be saved by the credential manager. If the credential manager is disabled for the caller's logon session, or if the network provider does not support saving credentials,

Best此致,

Best Regards,

Hart

更多推荐

WNetAddConnection2似乎缓存了密码

本文发布于:2023-11-24 09:02:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1624576.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:缓存   密码

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!