The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Domain name issue with .Net

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Paschal

Posts: 1621
Nickname: bigapple
Registered: Nov, 2003

Paschal is a .Net developer
Domain name issue with .Net Posted: Jan 13, 2004 5:58 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Paschal.
Original Post: Domain name issue with .Net
Feed Title: help.net
Feed URL: http://www.asp.net/err404.htm?aspxerrorpath=/pleloup/Rss.aspx
Feed Description: .Net for mankind !
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Paschal
Latest Posts From help.net

Advertisement

In a project I need to know the name of the machine where the code run.

Everything ok on different servers (MyServerName for example) , exception of a new one I just finished to setup (Windows 2003).

The name I got is quite unusual, at least for me, NT AUTHORITY.

This is the code (response.write is for testing only)

Someone has an idea ?

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
   Dim ThisDomain As String = GetDomainName()
   response.write(ThisDomain)
End Sub

Public Function GetDomainName() As String
   Dim tmp As String = Principal.WindowsIdentity.GetCurrent.Name()
   Dim pos As Short Dim result As String pos = InStr(tmp, "\")
   If pos <> 0 Then
    result = Microsoft.VisualBasic.Left(tmp, pos - 1) 
   End If
   Return result
End Function

 

Read: Domain name issue with .Net

Topic: Geek Notes 2004-01-11 Previous Topic   Next Topic Topic: REVIEWED: Microsoft Wrist.NET (MSN Direct) Watch from Fossil

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use