Getting Network domain name from ASP

Results 1 to 6 of 6

Thread: Getting Network domain name from ASP

  1. #1
    Harish H Guest

    Default Getting Network domain name from ASP

    I am developing an Intranet application in ASP, and every employee has a signed-on to the network domain. I want to design a page in such a way that, when user enters into that page, The corresponding Network user name logs in to the database. <BR><BR>Please help me out how to "retrive the Network domain name of an user" thru my ASP page.<BR><BR>THank you verymuch for your help.<BR><BR>Harish H

  2. #2
    django reinhardt Guest

    Default RE: Getting Network domain name from ASP

    i answered a question similar to this not too long ago, but for the life of me, i can&#039;t find my original post<BR><BR>so i&#039;ll offer this suggestion again (keep in mind that i haven&#039;t tried this from an asp page but i think it should still work)<BR><BR>make a com object that makes a call to an api function using the following code:<BR><BR>&#039;The API function declaration<BR>Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long<BR><BR>&#039;The function to call the API function and get the user id<BR>Private Function GetUserID() As String<BR> Dim lBuffer As Long<BR> Dim lTemp As Long<BR> Dim sTemp As String<BR> <BR> sTemp = String(1024, 0)<BR> lBuffer = 1024<BR> &#039;Make API call<BR> lTemp = GetUserName(sTemp, lBuffer)<BR> sTemp = Mid(sTemp, 1, InStr(sTemp, Chr(0)) - 1)<BR> <BR> GetUserID = sTemp<BR>End Function<BR><BR>this code works beautifully in vb6 - a com object should work the same - but there&#039;s only one way to find out<BR><BR>good luck

  3. #3
    django reinhardt Guest

    Default what the #&@$@#* am i thinking?

    look at this post (if you haven&#039;t already):

  4. #4
    Join Date
    Dec 1969

    Default Yeah, what the hell were you thinking?


  5. #5
    django reinhardt Guest

    Default obviously not much :) <eop>


  6. #6
    Harish H Guest

    Default RE: Getting Network domain name from ASP

    Hi,<BR>Thanx.<BR>I already tried this vb6.0 dll and called from ASP. BUt it picks up the server machine&#039; Username.<BR>BUt i need the Userid of the client accessing that page<BR><BR>Harish H

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts