Solved

Username detection

Posted on 2003-11-30
6
243 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This video teaches viewers about errors in exception handling.

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now