获取用户的电子邮件地址? [英] Acquire a user's email address?

查看:245
本文介绍了获取用户的电子邮件地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法通过Win32或.NET从Windows中获取用户的电子邮件地址?是否有注册表项或API包含此信息?



编辑:如果我们的应用程序失败,我有一封电子邮件给我的公司的应用程序,并且我想获得一个返回的电子邮件地址所以我们可以回应那些经历了崩溃的人。我正在收到用户名,但可能与电子邮件名称不符。显然,我可以让用户输入他的电子邮件地址,但是如果我至少尝试获取电子邮件地址,并让用户验证返回电子邮件地址是否正确,那么该界面将会更加友善。

解决方案

我认为这是有道理的唯一方法是在Windows Active Directory环境中。在这种情况下,您可以查询AD,并查看是否有与用户帐户关联的电子邮件地址。这一定与MS Exchange一起工作,也可以与其他企业电子邮件系统一起使用。对于.Net,您可以使用 System.DirectoryServices 命名空间。对于Win32,您可以使用 ADSI API。您必须在AD上阅读并创建一个适合您的要求的查询。


Is there a way to get the user's email address from within Windows via Win32 or .NET? Is there a registry key or API that contains this information?

EDIT: I have an application that emails my company if our application fails and I wanted to get a return email address so that we could respond that individual that experienced the crash. I'm currently getting the username, but that may not match the email name. Obviously I can get the user to enter his email address, but the interface would be a little friendlier if I could at least attempt to acquire the email address and have the user verify that the return email address is correct.

解决方案

The only way I can think that this would make sense is in a Windows Active Directory environment. In this case you can query AD and see if there's an email address associated with the user's account. This will definitely work with MS Exchange and may also work with other enterprise email systems. For .Net you can use the classes in the System.DirectoryServices namespace. For Win32 you can use the ADSI API. You will have to read up on AD and create a suitable query to match your requirements.

这篇关于获取用户的电子邮件地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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