Get the Name and Phone Number of the Current Windows User in a .NET
Application
I am writing a simple .NET (C#) application. It needs to "automatic"
get the Name (last, first) and phone number of the current Windows
user.
I guess the name can be retrieved from the environment -- After I
click the Start button of Windows, my name is on the very first line
of the popup menu. So, this information is provided by the Windows
environment.
My question is how I get this environment information in a C#
application.
I also need to get the phone number of the current Windows user. I
can safely assume:
(1) Outlook is installed.
(2) The phone number of the current Windows user is in the Outlook
profile.
Is there a way to obtain the phone number of the current Windows
user? We canNOT assume that Outlook is running when my application is
running.
Your input is highly appreciated.
Thanks.
Alex 9 2983
You might try the microsoft.public.officedev ng[1]. There's more people
hanging out there that are familar with developing with Outlook.
[1] http://msdn.microsoft.com/newsgroups...&lang=en&cr=US
--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote. http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#
"Alex" wrote:
Get the Name and Phone Number of the Current Windows User in a .NET
Application
I am writing a simple .NET (C#) application. It needs to "automatic"
get the Name (last, first) and phone number of the current Windows
user.
I guess the name can be retrieved from the environment -- After I
click the Start button of Windows, my name is on the very first line
of the popup menu. So, this information is provided by the Windows
environment.
My question is how I get this environment information in a C#
application.
I also need to get the phone number of the current Windows user. I
can safely assume:
(1) Outlook is installed.
(2) The phone number of the current Windows user is in the Outlook
profile.
Is there a way to obtain the phone number of the current Windows
user? We canNOT assume that Outlook is running when my application is
running.
Your input is highly appreciated.
Thanks.
Alex
Alex,
This is going to be near impossible. First, the full name of a user is
not always stored with the user account. You can get that from the Outlook
profile most likely (or any Office app, through interop), but the phone
number is by no means guaranteed.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Alex" <bo*******@gmail.comwrote in message
news:11**********************@r34g2000hsd.googlegr oups.com...
Get the Name and Phone Number of the Current Windows User in a .NET
Application
I am writing a simple .NET (C#) application. It needs to "automatic"
get the Name (last, first) and phone number of the current Windows
user.
I guess the name can be retrieved from the environment -- After I
click the Start button of Windows, my name is on the very first line
of the popup menu. So, this information is provided by the Windows
environment.
My question is how I get this environment information in a C#
application.
I also need to get the phone number of the current Windows user. I
can safely assume:
(1) Outlook is installed.
(2) The phone number of the current Windows user is in the Outlook
profile.
Is there a way to obtain the phone number of the current Windows
user? We canNOT assume that Outlook is running when my application is
running.
Your input is highly appreciated.
Thanks.
Alex
You can get the current user name by using Environment.UserName
The logon name may differ from the legal name of the user. For example, many
users log on as "Administrator"...
--
Sheng Jiang
Microsoft MVP in VC++
"Alex" <bo*******@gmail.comwrote in message
news:11**********************@r34g2000hsd.googlegr oups.com...
Get the Name and Phone Number of the Current Windows User in a .NET
Application
I am writing a simple .NET (C#) application. It needs to "automatic"
get the Name (last, first) and phone number of the current Windows
user.
I guess the name can be retrieved from the environment -- After I
click the Start button of Windows, my name is on the very first line
of the popup menu. So, this information is provided by the Windows
environment.
My question is how I get this environment information in a C#
application.
I also need to get the phone number of the current Windows user. I
can safely assume:
(1) Outlook is installed.
(2) The phone number of the current Windows user is in the Outlook
profile.
Is there a way to obtain the phone number of the current Windows
user? We canNOT assume that Outlook is running when my application is
running.
Your input is highly appreciated.
Thanks.
Alex
Thanks, Nick for the input.
The people who uses my application have already had their Windows and
Outlook properly set up.
On Jul 10, 2:16 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Alex,
This is going to be near impossible. First, the full name of a user is
not always stored with the user account. You can get that from the Outlook
profile most likely (or any Office app, through interop), but the phone
number is by no means guaranteed.
--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com
"Alex" <bohema...@gmail.comwrote in message
news:11**********************@r34g2000hsd.googlegr oups.com...
Get the Name and Phone Number of the Current Windows User in a .NET
Application
I am writing a simple .NET (C#) application. It needs to "automatic"
get the Name (last, first) and phone number of the current Windows
user.
I guess the name can be retrieved from the environment -- After I
click the Start button of Windows, my name is on the very first line
of the popup menu. So, this information is provided by the Windows
environment.
My question is how I get this environment information in a C#
application.
I also need to get the phone number of the current Windows user. I
can safely assume:
(1) Outlook is installed.
(2) The phone number of the current Windows user is in the Outlook
profile.
Is there a way to obtain the phone number of the current Windows
user? We canNOT assume that Outlook is running when my application is
running.
Your input is highly appreciated.
Thanks.
Alex- Hide quoted text -
- Show quoted text -
Sheng,
Thanks for the input. Let's say my logon name is AlexLogOnName, but
when I click the Start Button of my Windows, my name -- LastName, Alex
-- is shown in the popup menu. I guess my Windows is properly set up
with user's logon name and user's real name (Last, first). Any input
on how windows differentiate logon and real name (last, first)?
On Jul 10, 3:03 pm, "Sheng Jiang[MVP]"
<sheng_ji...@hotmail.com.discusswrote:
You can get the current user name by using Environment.UserName
The logon name may differ from the legal name of the user. For example, many
users log on as "Administrator"...
--
Sheng Jiang
Microsoft MVP in VC++"Alex" <bohema...@gmail.comwrote in message
news:11**********************@r34g2000hsd.googlegr oups.com...
Get the Name and Phone Number of the Current Windows User in a .NET
Application
I am writing a simple .NET (C#) application. It needs to "automatic"
get the Name (last, first) and phone number of the current Windows
user.
I guess the name can be retrieved from the environment -- After I
click the Start button of Windows, my name is on the very first line
of the popup menu. So, this information is provided by the Windows
environment.
My question is how I get this environment information in a C#
application.
I also need to get the phone number of the current Windows user. I
can safely assume:
(1) Outlook is installed.
(2) The phone number of the current Windows user is in the Outlook
profile.
Is there a way to obtain the phone number of the current Windows
user? We canNOT assume that Outlook is running when my application is
running.
Your input is highly appreciated.
Thanks.
Alex- Hide quoted text -
- Show quoted text -
Alex,
If that's the case, then you should be able to access the information in
Outlook through the Outlook object model (using the primary interop
assemblies for Outlook).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Alex" <bo*******@gmail.comwrote in message
news:11**********************@p39g2000hse.googlegr oups.com...
Thanks, Nick for the input.
The people who uses my application have already had their Windows and
Outlook properly set up.
On Jul 10, 2:16 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
>Alex,
This is going to be near impossible. First, the full name of a user is not always stored with the user account. You can get that from the Outlook profile most likely (or any Office app, through interop), but the phone number is by no means guaranteed.
-- - Nicholas Paldino [.NET/C# MVP] - m...@spam.guard.caspershouse.com
"Alex" <bohema...@gmail.comwrote in message
news:11**********************@r34g2000hsd.googleg roups.com...
Get the Name and Phone Number of the Current Windows User in a .NET
Application
I am writing a simple .NET (C#) application. It needs to "automatic"
get the Name (last, first) and phone number of the current Windows
user.
I guess the name can be retrieved from the environment -- After I
click the Start button of Windows, my name is on the very first line
of the popup menu. So, this information is provided by the Windows
environment.
My question is how I get this environment information in a C#
application.
I also need to get the phone number of the current Windows user. I
can safely assume:
(1) Outlook is installed.
(2) The phone number of the current Windows user is in the Outlook
profile.
Is there a way to obtain the phone number of the current Windows
user? We canNOT assume that Outlook is running when my application is
running.
Your input is highly appreciated.
Thanks.
Alex- Hide quoted text -
- Show quoted text -
Thanks. Nick ...
Alex
On Jul 10, 3:17 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Alex,
If that's the case, then you should be able to access the information in
Outlook through the Outlook object model (using the primary interop
assemblies for Outlook).
--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com
"Alex" <bohema...@gmail.comwrote in message
news:11**********************@p39g2000hse.googlegr oups.com...
Thanks, Nick for the input.
The people who uses my application have already had their Windows and
Outlook properly set up.
On Jul 10, 2:16 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.comwrote:
Alex,
This is going to be near impossible. First, the full name of a user
is
not always stored with the user account. You can get that from the
Outlook
profile most likely (or any Office app, through interop), but the phone
number is by no means guaranteed.
--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard.caspershouse.com
"Alex" <bohema...@gmail.comwrote in message
>news:11**********************@r34g2000hsd.googleg roups.com...
Get the Name and Phone Number of the Current Windows User in a .NET
Application
I am writing a simple .NET (C#) application. It needs to "automatic"
get the Name (last, first) and phone number of the current Windows
user.
I guess the name can be retrieved from the environment -- After I
click the Start button of Windows, my name is on the very first line
of the popup menu. So, this information is provided by the Windows
environment.
My question is how I get this environment information in a C#
application.
I also need to get the phone number of the current Windows user. I
can safely assume:
(1) Outlook is installed.
(2) The phone number of the current Windows user is in the Outlook
profile.
Is there a way to obtain the phone number of the current Windows
user? We canNOT assume that Outlook is running when my application is
running.
Your input is highly appreciated.
Thanks.
Alex- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -
try NetUserGetInfo http://pinvoke.net/default.aspx/neta...erGetInfo.html
--
Sheng Jiang
Microsoft MVP in VC++
"Alex" <bo*******@gmail.comwrote in message
news:11*********************@n2g2000hse.googlegrou ps.com...
Sheng,
Thanks for the input. Let's say my logon name is AlexLogOnName, but
when I click the Start Button of my Windows, my name -- LastName, Alex
-- is shown in the popup menu. I guess my Windows is properly set up
with user's logon name and user's real name (Last, first). Any input
on how windows differentiate logon and real name (last, first)?
On Jul 10, 3:03 pm, "Sheng Jiang[MVP]"
<sheng_ji...@hotmail.com.discusswrote:
You can get the current user name by using Environment.UserName
The logon name may differ from the legal name of the user. For example,
many
users log on as "Administrator"...
--
Sheng Jiang
Microsoft MVP in VC++"Alex" <bohema...@gmail.comwrote in message
news:11**********************@r34g2000hsd.googlegr oups.com...
Get the Name and Phone Number of the Current Windows User in a .NET
Application
I am writing a simple .NET (C#) application. It needs to "automatic"
get the Name (last, first) and phone number of the current Windows
user.
I guess the name can be retrieved from the environment -- After I
click the Start button of Windows, my name is on the very first line
of the popup menu. So, this information is provided by the Windows
environment.
My question is how I get this environment information in a C#
application.
I also need to get the phone number of the current Windows user. I
can safely assume:
(1) Outlook is installed.
(2) The phone number of the current Windows user is in the Outlook
profile.
Is there a way to obtain the phone number of the current Windows
user? We canNOT assume that Outlook is running when my application is
running.
Your input is highly appreciated.
Thanks.
Alex- Hide quoted text -
- Show quoted text -
First, thank you for all your help
Some update:
1. I can easily get users Windows login name which is the SAME as
Outlook email Alias, by using Environment.UserName
2. After add Outlook Object references, I can do something like:
Outlook._Application olApp = new
Outlook.ApplicationClass();
Outlook.NameSpace oNS = olApp.GetNamespace("MAPI");
Outlook.AddressList oAL = oNS.AddressLists["Global Address
List"];
Outlook.AddressEntries oAEs = oAL.AddressEntries;
In this way, I can get the AddressEntries. My question is can I
search the AddressEntries for the user login name I found by using
Environment.UserName? I did not find a method for search/find
On Jul 10, 1:49 pm, Alex <bohema...@gmail.comwrote:
Get the Name and Phone Number of the Current Windows User in a .NET
Application
I am writing a simple .NET (C#) application. It needs to "automatic"
get the Name (last, first) and phone number of the current Windows
user.
I guess the name can be retrieved from the environment -- After I
click the Start button of Windows, my name is on the very first line
of the popup menu. So, this information is provided by the Windows
environment.
My question is how I get this environment information in a C#
application.
I also need to get the phone number of the current Windows user. I
can safely assume:
(1) Outlook is installed.
(2) The phone number of the current Windows user is in the Outlook
profile.
Is there a way to obtain the phone number of the current Windows
user? We canNOT assume that Outlook is running when my application is
running.
Your input is highly appreciated.
Thanks.
Alex
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Robert Mark Bram |
last post by:
Hi All!
Is there a way to reference a window by name without doing something like
this:
open (, 'windowName');
The open method will open a blank window if there is no window with such a
name....
|
by: Tomasz \Boruh\ Borowiak |
last post by:
Does anybody have any idea how to write a c++ console application which
simulates the mobile phone keyboard ?
for Example: when i write SMS
I hit 2 - I get "a"
I hit 22 - I get "b"
I hit 222...
|
by: deko |
last post by:
I have a (Access 2003) contact management database where the user can
double-click a contact's phone number in a form and have the Windows Phone
Dialer dial the number. The problem is the number...
|
by: Prasad Karunakaran |
last post by:
I am using the C# DirectoryEntry class to retrieve the Properties of
an user object in the Active Directory. I need to get the First Name
and Last Name as properties. I know it is not supported...
|
by: Ray |
last post by:
Dear all,
Now, I have 3 projects of class library and 1 project of window
application. The window application will call the 3 class librarys. So
should I make 4 .snk files for each project? Or one...
|
by: Earl |
last post by:
I'm curious if there are others who have a better method of
accepting/parsing phone numbers. I've used a couple of different techniques
that are functional but I can't really say that I'm totally...
|
by: Arthur |
last post by:
Hi All,
I would like to get the name of the user given their networkID, is this
something Active Directory would be useful for?(For intranet users)
If so, can you please point me to some sample...
|
by: hennas |
last post by:
Basically i want to design a membership Name and Telephone List form using the following command buttons.
Edit
Add New;
Update;
Delete;
Cancel;
Save;
Clear, and
Exit
|
by: =?Utf-8?B?SmFtZXMgV29uZw==?= |
last post by:
Hi everybody,
I'm trying to use the new VB 2008 right now and I want to know how to preset
the company name and copyright informtion in Assembly Information. In my
current VB 2005, company name...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |