create and use DLL

Posted on 2006-05-29
Medium Priority
Last Modified: 2010-04-30
how would i create and new my own DLL to retrieve and display the username of the user logged into a Win NT machine?

p.s i have never done this before
Question by:ellandrd
  • 4
LVL 93

Accepted Solution

Patrick Matthews earned 2000 total points
ID: 16784096
Hi ellandrd,

There is no need to make a DLL for this, as an API function already exists:



LVL 16

Author Comment

ID: 16784151
but how do i run it so i can display the username in a webpage?
LVL 16

Author Comment

ID: 16784160
what is mean by new module?  how cani run this? what type of extension does it have?

sorry i have never done anything like this before so it is all new to me...
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

LVL 10

Expert Comment

ID: 16784306
If you're website is using IIS with Integrated Windows Authentication then you can simply use:

  Dim UserName

  UserName = Request.ServerVariables("LOGON_USER")

  if InStr(UserName,"\")>0 then
    UserName = Right(UserName,Len(UserName) - InStr(UserName,"\"))
  end if


to get the NT Username, although you need to make sure "anonymous access" is unchecked. To check this right-click the website in IIS, select "properties", select the "Directory Security" tab and in the "Anonymous Access and Authentication Control" box at the top click the "Edit" button.
LVL 16

Author Comment

ID: 16784375
>>to get the NT Username, although you need to make sure "anonymous access" is unchecked.

this be be done - we need this checked for other reasons so using auth_user wont work...
LVL 16

Author Comment

ID: 16788251
how do i use this DLL already created? you never said how i use it?

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month13 days, 8 hours left to enroll

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question