 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jeff Guest
|
Posted: Fri May 13, 2005 2:22 pm Post subject: Getting the user's email addres |
|
|
Does anyone know what the best way to get a logged in user's email address
would be? I've got a machine in a Windows domain which people log into, and
I'd like to find out the currently logged in user's email address.
Please advise,
Jeff
|
|
| Back to top |
|
 |
Alan Bellingham Guest
|
Posted: Fri May 13, 2005 6:06 pm Post subject: Re: Getting the user's email addres |
|
|
"Jeff" <Jeff (AT) nospam (DOT) com> wrote:
| Quote: | Does anyone know what the best way to get a logged in user's email address
would be? I've got a machine in a Windows domain which people log into, and
I'd like to find out the currently logged in user's email address.
|
Why don't you ask the user?
The way you ask this question makes several assumptions, including
1: The user has an email address
2: The user has one email address
3: The user doesn't mind your code knowing it
I suggest you ask and then store the result in the registry under the
HKEY_CURRENT_USER entry for future reference.
Alan Bellingham
--
Me <url:mailto:alanb (AT) episys (DOT) com> <url:http://www.doughnut.demon.co.uk/>
ACCU - C, C++ and Java programming <url:http://accu.org/>
The 2004 Discworld Convention <url:http://dwcon.org/>
|
|
| Back to top |
|
 |
Jeff Guest
|
Posted: Fri May 13, 2005 6:46 pm Post subject: Re: Getting the user's email addres |
|
|
This will be running on a machine that many people will log into and use. I
was just hoping to find a way to make it "fool-proof" for the user. Since
we're all in the same domain, we each have an email address.
"Alan Bellingham" <alanb (AT) episys (DOT) com> wrote
| Quote: | "Jeff" <Jeff (AT) nospam (DOT) com> wrote:
Does anyone know what the best way to get a logged in user's email address
would be? I've got a machine in a Windows domain which people log into,
and
I'd like to find out the currently logged in user's email address.
Why don't you ask the user?
The way you ask this question makes several assumptions, including
1: The user has an email address
2: The user has one email address
3: The user doesn't mind your code knowing it
I suggest you ask and then store the result in the registry under the
HKEY_CURRENT_USER entry for future reference.
Alan Bellingham
--
Me <url:mailto:alanb (AT) episys (DOT) com> http://www.doughnut.demon.co.uk/
ACCU - C, C++ and Java programming http://accu.org/
The 2004 Discworld Convention http://dwcon.org/
|
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri May 13, 2005 6:56 pm Post subject: Re: Getting the user's email addres |
|
|
"Jeff" <Jeff (AT) nospam (DOT) com> wrote
| Quote: | Does anyone know what the best way to get a logged in user's email
address would be? I've got a machine in a Windows domain which
people log into, and I'd like to find out the currently logged in user's
email address.
|
There is no standard way to do what you ask. The email address is not
stored by the OS anywhere, and any email program(s) that the user may be
using will store the email address differently than every other email
program. Every program is different. You would have to look at the
specific settings of each individual program that you want to support
(Outlook, Eudora, Netscape, etc), figure out which one is actually installed
on the machine, figure out where the settings are stored, extract it
manually, etc.
You are better off just asking the user what his/her email address is.
Gambit
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri May 13, 2005 7:01 pm Post subject: Re: Getting the user's email addres |
|
|
"Jeff" <Jeff (AT) nospam (DOT) com> wrote
| Quote: | I was just hoping to find a way to make it "fool-proof" for the user.
|
There's pretty much no such thing ;-)
| Quote: | Since we're all in the same domain, we each have an email address.
|
The only other possibility to consider, other than what has already been
stated, is if each user has a network login username that is the same
mailbox name of their email addresses, and if the machine is logging into a
network server that has the same domain as the email server. For example,
if "joe" logs into network "smoe.com" and has an email address of
"joe (AT) smoe (DOT) com", then you can use GetUserName() to find out who is currently
logged into the machine, and LookupAccountName() to get the domain that the
machine belongs to.
Gambit
|
|
| Back to top |
|
 |
Jeff Guest
|
Posted: Fri May 13, 2005 8:31 pm Post subject: Re: Getting the user's email addres |
|
|
Thanks.
"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote
| Quote: |
"Jeff" <Jeff (AT) nospam (DOT) com> wrote in message
news:4284b811 (AT) newsgroups (DOT) borland.com...
Does anyone know what the best way to get a logged in user's email
address would be? I've got a machine in a Windows domain which
people log into, and I'd like to find out the currently logged in user's
email address.
There is no standard way to do what you ask. The email address is not
stored by the OS anywhere, and any email program(s) that the user may be
using will store the email address differently than every other email
program. Every program is different. You would have to look at the
specific settings of each individual program that you want to support
(Outlook, Eudora, Netscape, etc), figure out which one is actually
installed
on the machine, figure out where the settings are stored, extract it
manually, etc.
You are better off just asking the user what his/her email address is.
Gambit
|
|
|
| Back to top |
|
 |
Jeff Guest
|
Posted: Fri Jun 17, 2005 5:57 pm Post subject: Re: Getting the user's email addres |
|
|
I guess I should have said this earlier, but this is for an engineering
tool that will be used only within our organization. Therefore everyone is
logging into the same domain, and has a similar email address
(joe.smoe (AT) smoe (DOT) com).
So I'd like to get the users full name somehow. I've looked at using
NetUserGetInfo() but it doesn't work with Windows 98. I can get the user's
UserName using GetUserName() (jsmoe), but I need a way to get the user's
full name that is compatible with Windows 98.
Thanks,
Jeff
"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote
| Quote: |
"Jeff" <Jeff (AT) nospam (DOT) com> wrote in message
news:4284f5ee$1 (AT) newsgroups (DOT) borland.com...
I was just hoping to find a way to make it "fool-proof" for the user.
There's pretty much no such thing ;-)
Since we're all in the same domain, we each have an email address.
The only other possibility to consider, other than what has already been
stated, is if each user has a network login username that is the same
mailbox name of their email addresses, and if the machine is logging into
a
network server that has the same domain as the email server. For example,
if "joe" logs into network "smoe.com" and has an email address of
"joe (AT) smoe (DOT) com", then you can use GetUserName() to find out who is
currently
logged into the machine, and LookupAccountName() to get the domain that
the
machine belongs to.
Gambit
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|