CredWrite和CRED_PERSIST_LOCAL_MACHINE [英] CredWrite and CRED_PERSIST_LOCAL_MACHINE

查看:108
本文介绍了CredWrite和CRED_PERSIST_LOCAL_MACHINE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我希望我找到了正确的地方.我正在使用CredRead和CredWrite为我的应用程序保存用户名和密码.这一直很好,直到我最近发现某些风味的Vista和XP不支持我使用的CRED_PERSIST_LOCAL_MACHINE标志(http://msdn.microsoft.com/zh-cn/library/aa374788%28VS.85 %29.aspx). :(

我一直在寻找可以使用的替代API,但到目前为止还没有运气.CredUIPromptForCredentials几乎可以用,除了有时候我需要能够编写凭据据我所知,CredUIPromptForCredentials无法做到这一点.还有其他可用选项吗?

干杯,
Colin

Hi all,

I hope I've found the right place.  I'm using CredRead and CredWrite to save a username and password for my application.  This has been working great, until I recently discovered that the CRED_PERSIST_LOCAL_MACHINE flag I'm using isn't supported by certain flavors Vista and XP (http://msdn.microsoft.com/en-us/library/aa374788%28VS.85%29.aspx). :(

I've been looking for an alternative API I can use, but haven't had any luck so far.  CredUIPromptForCredentials almost works, except that there are times I need to be able to write credentials without prompting the user first.  As far as I can tell, there's no way to do this with CredUIPromptForCredentials.  Are there any other options available?

Cheers,
Colin

推荐答案

科林:

您使用CredUIConfirmCredentials()函数检索凭据,
注意:CredUIConfirmCredentials()函数是还可以保留凭据
[只需将CREDUI_FLAGS_EXPECT_CONFIRMATION标志传递给提示"功能].

我希望此信息对您有所帮助.


/> 进一步阅读:
http: //msdn.microsoft.com/zh-CN/library/aa374788(VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa375173(VS.85).aspx

祝您有美好的一天...

最好的问候,
Fisnik

Hi Colin: 

Your using the CredUIConfirmCredentials() Function, to retrieve the credentials,
note: The CredUIConfirmCredentials() Function is also able to persist the credentials
[just pass the CREDUI_FLAGS_EXPECT_CONFIRMATION flag to the "prompt" function].

I hope this information was good and helpful...

For further reading:
http://msdn.microsoft.com/en-us/library/aa374788(VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa375173(VS.85).aspx

Have a nice day...

Best regards,
Fisnik  


这篇关于CredWrite和CRED_PERSIST_LOCAL_MACHINE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆