deshaw
asked on
C/C++ : How to get the remote logged on user from IP address
Hi,
My problem is, I want to retrieve the logged on user on remote machine. I will have remote machine's IP address. Is there any way to retrieve the information which says that the use XXX has been logged on this machine?
Thanks
My problem is, I want to retrieve the logged on user on remote machine. I will have remote machine's IP address. Is there any way to retrieve the information which says that the use XXX has been logged on this machine?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have removed most of errors but I am not able to remove below errors. Could anyone tell me how to remove it. One more thing I dont know why this code expect UNICODE defined? I am compiling code in Release mode.
Error259 error C2664: 'wcsicmp' : cannot convert parameter 1 from 'LPSTR' to 'const wchar_t *'
Error260 error C2665: 'wcsstr' : none of the 2 overloads could convert all the argument types
Error261 error C2664: 'swscanf' : cannot convert parameter 1 from 'LPSTR' to 'const wchar_t
Error262 error C2664: 'wcsicmp' : cannot convert parameter 2 from 'LPSTR' to 'const wchar_t *'
Thanks
Error259 error C2664: 'wcsicmp' : cannot convert parameter 1 from 'LPSTR' to 'const wchar_t *'
Error260 error C2665: 'wcsstr' : none of the 2 overloads could convert all the argument types
Error261 error C2664: 'swscanf' : cannot convert parameter 1 from 'LPSTR' to 'const wchar_t
Error262 error C2664: 'wcsicmp' : cannot convert parameter 2 from 'LPSTR' to 'const wchar_t *'
Thanks
ASKER
The condition "if( subAuthorityCount >= 3 ) {" never gets true and as a result it always says "No user logged on". Please let me know if you know the reason for this,
Thanks,
Thanks,
ASKER
Sorry, missed to tell you that I have used type casting - "(LPSTR)subKeyName" and all errors went off.
>>I have used type casting - "(LPSTR)subKeyName" and all errors went off.
Actually, it is not a good idea to typecast here - bettre set your project to UNICODE to get rid of these issues, this ensures that the code does not only compile but also run.
Actually, it is not a good idea to typecast here - bettre set your project to UNICODE to get rid of these issues, this ensures that the code does not only compile but also run.
ASKER
Thanks, ikr
http://read.pudn.com/downloads/sourcecode/windows/system/1439/LOGGEDON.C__.htm