[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Getting username on WinNT / Win95

Posted on 1998-09-01
4
Medium Priority
?
221 Views
Last Modified: 2013-12-03
I have a program and need to get the current user that is logged in on the WinNT or Win95 machine.  I am using ILOG as the API.  Is there an easy way to get the user information.  I tried using the USER_INFO_10 struct, but was unsuccessful. If this is the method of choice, can someone give a quick example on how to use the struct properly.

Thanks,
Shawn
0
Comment
Question by:sgrobins
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Expert Comment

by:Answers2000
ID: 1414114
Can't you use GetUserName

USER_INFO_10 structure is typically used with NetUserEnum API which enumerates all user accounts on a server.

Exactly what information do you need about the current user ?
0
 

Expert Comment

by:ratheesh
ID: 1414115
There is an SDK Function GetUserName(LPCTSTR StringPointer, DWORD* LengthofAllocatedString) which will return user name in StringPointer.
0
 
LVL 8

Accepted Solution

by:
Answers2000 earned 200 total points
ID: 1414116
ratheesh -
I thought I said that yesterday <g>, maybe there's an echo in here.

sgrobins -
GetUserName will give you the account name of the current user.  Use LookupAccountName to find further information on that user.  
I think this is enough for you ?  If it's not enough post further comments telling us what else you need.

BTW NetUserEnum gives you Unicode strings back.  So if you stick to this funciton, you either need to compile you app as Unicode OR to convert the returned strings into 8 bit character set
0
 

Author Comment

by:sgrobins
ID: 1414117
GetUserName worked perfectly.  Not sure how I overlooked that one, but Thanks.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

650 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