Solved

Username detection

Posted on 2003-11-30
6
247 Views
Last Modified: 2010-03-31
I want to be able to detect the name of a user running a java application. This will not be running via applet in a browser.

           Please post any help for me
0
Comment
Question by:JTWolfman
  • 4
  • 2
6 Comments
 
LVL 92

Accepted Solution

by:
objects earned 100 total points
ID: 9847818
try:

System.getProperty("user.name");

But you'll need to sign the applet.
0
 
LVL 92

Expert Comment

by:objects
ID: 9847863
0
 

Author Comment

by:JTWolfman
ID: 9848019
one more question, if you dont mind. How do i check if the username is a particular name?
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 92

Expert Comment

by:objects
ID: 9848044
String username = System.getProperty("user.name");
if (username.equals("JTWolfman"))
{
   // do whatever
}
0
 

Author Comment

by:JTWolfman
ID: 9848154
thanks man, your a life saver
0
 
LVL 92

Expert Comment

by:objects
ID: 9848171
No worries, happy I could help.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

808 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