This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I wondering if it is possible to get user username the user has logged on to his w2k with and then use it in a servlet/jsp? More precisly is it like this I want to do: 1. When a user clicks on a link, his w2k username is fetched and checked against some data that is is stored in a dataset. 2. If the dataset contains the username it will display the desired page. If NOT the dataset contains the username it will display a message page. -- in other words I don't want to have some username/password to be entered? Is it possible and if so, how? /Emil Karlsson
To get the user name you will have to make a native call to a Windows dll. The function you need is WNetGetUser in MPR.DLL. Chech the WinAPI from Micro$oft for details. I have not coded it in Java, but here it is in VB:
Tom Blough<br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr>Cum catapultae proscriptae erunt tum soli proscripti catapultas habebunt.<hr></blockquote>