Anis Yusof

Greenhorn
+ Follow
since Sep 24, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Anis Yusof

Guys,

I need to code up an application that actually controls the PC's login and logout via a handphone(Android phone). The user initiate the login and logout through the handphone, wirelessly. I have set up a listener on the computer, listening for login or logout commands from the phone. I've managed to set up the log out function on the listener, which interface with the cmd via the code below.

This code will log off the current account and return to the account selection screen (Windows 7). But now, how do I code up the listener so that, when the user initiate a logon request from the phone(assuming the credentials are provided from the phone), the PC will be logged in based on the credentials?

After some googling, I've found some methods, but it does not work. I tried using system call such as executing "logon -u userName -p 12345", but unfortunately win7 does not support "logon" command. Other solution such as executing "net user" also does not really fit into my current situation. Maybe, is there a way for me to control winlogon.exe from the listener(which is coded in Java)?

Thank you very much for your kind help! Do hope you provide me some answers or advice on how to advance from here.
13 years ago
Thank you gupta_tarun & wouter_oet! Both of you really helps me a lot; except both solution take a different approach. It is certainly good learning experience for me to be introduced to Map, Hashmap etc. Never heard & used of hashmap before.. :P anyway, i used wouter solution in my codes. Kinda neat & easy to understand, and it works! thanks again guys!
14 years ago
Hello everyone.

I have a problem. I would like to know, how to count for duplicate object, and return the highest occurence of object in an ArrayList. For this instance, I am using ArrayList <Integer>; I believed it is also possible for me to use int []. Anyway, these are the sample codes.



In the above codes, there are three 1s, two 2s, and probably other integer that is randomly added. Hence, i want it to return me the Integer 1 object; since Integer 1 occurs the most in this ArrayList.

I have googled it, and searched this forum. But unfortunately, I didn't find what I want. Please help. Thanks!
14 years ago