[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Username detection

Posted on 2003-11-30
6
Medium Priority
?
252 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 400 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
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 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
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:
Suggested Courses
Course of the Month17 days, 15 hours left to enroll

829 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