473,396 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Get the domain name

Hello friends

I need to create a simple application that returns the domain name where the
user name logs in. For example, if I acccess in a computer with the domain
user Contoso\bruno, my application should return the value "CONTOSO".
Basically, my application when executed in a pc that belongs to a domain,
must return the CONTOSO.COM (domain name). All this in Visual Basic.net.

Thank you for help

Nov 21 '05 #1
4 2030
Bruno, this works fine for me

' Only works on NT or higher - not Win98,ME
If System.Environment.OSVersion.Platform = PlatformID.Win32NT Then
Diagnostics.Debug.WriteLine(System.Environment.Use rDomainName())
End If

Dunno about the FQD name though

Bye,
Marius.

"Bruno" <Br***@discussions.microsoft.com> wrote in message
news:B3**********************************@microsof t.com...
Hello friends

I need to create a simple application that returns the domain name where
the
user name logs in. For example, if I acccess in a computer with the domain
user Contoso\bruno, my application should return the value "CONTOSO".
Basically, my application when executed in a pc that belongs to a domain,
must return the CONTOSO.COM (domain name). All this in Visual Basic.net.

Thank you for help

Nov 21 '05 #2
Thank You Marius for the help
but this return my user domain name, and I need my domain name like
contoso.com. Do you know how can I get this?
"Marius Groenendijk" wrote:
Bruno, this works fine for me

' Only works on NT or higher - not Win98,ME
If System.Environment.OSVersion.Platform = PlatformID.Win32NT Then
Diagnostics.Debug.WriteLine(System.Environment.Use rDomainName())
End If

Dunno about the FQD name though

Bye,
Marius.

"Bruno" <Br***@discussions.microsoft.com> wrote in message
news:B3**********************************@microsof t.com...
Hello friends

I need to create a simple application that returns the domain name where
the
user name logs in. For example, if I acccess in a computer with the domain
user Contoso\bruno, my application should return the value "CONTOSO".
Basically, my application when executed in a pc that belongs to a domain,
must return the CONTOSO.COM (domain name). All this in Visual Basic.net.

Thank you for help


Nov 21 '05 #3
Maybe this helps Bruno,

http://support.microsoft.com/default...;en-us;Q302656

System.Net.Dns.GetHostByName("LocalHost").HostName ()
Bye,
Marius.

"Bruno" <Br***@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.com...
Thank You Marius for the help
but this return my user domain name, and I need my domain name like
contoso.com. Do you know how can I get this?
"Marius Groenendijk" wrote:
Bruno, this works fine for me

' Only works on NT or higher - not Win98,ME
If System.Environment.OSVersion.Platform = PlatformID.Win32NT Then
Diagnostics.Debug.WriteLine(System.Environment.Use rDomainName())
End If

Dunno about the FQD name though

Bye,
Marius.

"Bruno" <Br***@discussions.microsoft.com> wrote in message
news:B3**********************************@microsof t.com...
> Hello friends
>
> I need to create a simple application that returns the domain name
> where
> the
> user name logs in. For example, if I acccess in a computer with the
> domain
> user Contoso\bruno, my application should return the value "CONTOSO".
> Basically, my application when executed in a pc that belongs to a
> domain,
> must return the CONTOSO.COM (domain name). All this in Visual
> Basic.net.
>
> Thank you for help
>


Nov 21 '05 #4
Thank very much you Marius, This helps me a lot!!!

Bruno

"Marius Groenendijk" wrote:
Maybe this helps Bruno,

http://support.microsoft.com/default...;en-us;Q302656

System.Net.Dns.GetHostByName("LocalHost").HostName ()
Bye,
Marius.

"Bruno" <Br***@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.com...
Thank You Marius for the help
but this return my user domain name, and I need my domain name like
contoso.com. Do you know how can I get this?
"Marius Groenendijk" wrote:
Bruno, this works fine for me

' Only works on NT or higher - not Win98,ME
If System.Environment.OSVersion.Platform = PlatformID.Win32NT Then
Diagnostics.Debug.WriteLine(System.Environment.Use rDomainName())
End If

Dunno about the FQD name though

Bye,
Marius.

"Bruno" <Br***@discussions.microsoft.com> wrote in message
news:B3**********************************@microsof t.com...
> Hello friends
>
> I need to create a simple application that returns the domain name
> where
> the
> user name logs in. For example, if I acccess in a computer with the
> domain
> user Contoso\bruno, my application should return the value "CONTOSO".
> Basically, my application when executed in a pc that belongs to a
> domain,
> must return the CONTOSO.COM (domain name). All this in Visual
> Basic.net.
>
> Thank you for help
>


Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jordan | last post by:
Suppose I register a domain name, MyDomain.com, through register.com (or any other of the many domain name registrars). I own the domain name. The domain name goes into the global DNS database. ...
3
by: Wysiwyg | last post by:
After a server created cookie is processed on the client I want it removed, cleared, or expired in the javascript block but have been unable to do this. If I set a cookie value in the server code...
3
by: Joe User | last post by:
Hi - I found the class below on another website (www.devx.com) and can't seem to figure out how to make a call to this class to retrieve the machines and put them in a listbox. I am definitely a...
5
by: Dany C. | last post by:
We have install a valid SSL certificate issued to www.mycompany.com on our web server running IIS 6.0 / win2003 SP1. Then we have created a sub domain pointing to the same server for our web...
6
by: Adam Tibi | last post by:
Hello, I want to get the right most name of the a domain name, for example: if the domain is www.myweb.com , I want to get myweb.com something.myweb.com --> myweb.com www.myweb.com.au --> ...
2
by: johkar | last post by:
I am getting an Access denied error when I write to a new window. The situation and code are outlined below. I am setting the domain in the main window. The problem is that the window I am...
10
by: Sridhar | last post by:
HI, I am having problems setting up a website so that it will be available only inside the domain. We have three servers. One is iis server and second one is internal server and the third one is...
9
by: Sam | last post by:
Validate domain name context Hello , Today I want to make sure from a given text is a domain style or not. for example : the domain can be example.com or example.com.us or example.us so ,...
6
by: Guy Macon | last post by:
While I agree with the sentiment, the oringinal title on this thread ("OT: Specially for , why you should always use example.com for obfuscating domains") is wrong. There are other reserved domain...
3
by: yaghout | last post by:
Hi, i need to check and retrive the mx records for a domain using asp .net , i am using .net 1.1 and prefer to use this framework version . ok , i found that i should use DNS protocol to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
1
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...
0
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.