DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C# (http://www.daniweb.com/forums/forum61.html)
-   -   Read keyboard in console application: a special case ! (http://www.daniweb.com/forums/thread145084.html)

sivaslieko++ Sep 10th, 2008 11:22 am
Read keyboard in console application: a special case !
 
Hi everybody,

I have been writing a windows console application in c#. I want it to read all keys pressed and write them all into a text file when a specific window is active in windows xp environment. Now, I can find the active window, but I failed to read keys entered when the intended window is active. ConsoleKey does not work..

Any recommendation?

Thanks..

LizR Sep 10th, 2008 1:10 pm
Re: Read keyboard in console application: a special case !
 
No it wouldnt, however, this sounds distinctly like a keylogger which is unfair and illegal and bad practice in many ways, there are ways to do it, but, Id be interested in the business justification of it before parting with anything like how to start doing it

sivaslieko++ Sep 10th, 2008 3:58 pm
Re: Read keyboard in console application: a special case !
 
I understand LizR. However, this is must for my master-thesis :(

I need to store all messages during the chat sessions among users. And my solution is to store keyboard entries when the chat window of the intended program is active. I could not think of any other solution...

I appreciate any help..
Best Regards

Narue Sep 10th, 2008 4:06 pm
Re: Read keyboard in console application: a special case !
 
>I need to store all messages during the chat sessions among users.
Is this some ad hoc chat program that doesn't support logging?

LizR Sep 10th, 2008 4:12 pm
Re: Read keyboard in console application: a special case !
 
I can, but to be honest, your thesis doesnt make it a legal thing.

sivaslieko++ Sep 10th, 2008 4:19 pm
Re: Read keyboard in console application: a special case !
 
I'm trying to improve the intended tool with some complementary features. Currently and unfortunately, it does not support logging of chat sessions. And also its API does not provide such a capability.

If I could program what I want then I will do what is required for legacy.. Also I appreciate any help about legacy..

Thanks for your time..
So, what should I do?

LizR Sep 10th, 2008 4:22 pm
Re: Read keyboard in console application: a special case !
 
As a side comment, Im not sure how logging an IM is going to ever form part of a thesis, however, surely writing a new IM that takes the current one and improves on it by adding the functionality you want is a far better use of all as users can then log, should they want, in a legal and healthy manner.

sivaslieko++ Sep 10th, 2008 4:39 pm
Re: Read keyboard in console application: a special case !
 
Actually, I like that idea, coding a new IM for the existing software tool, but I am not sure that my thesis-advisor will love it :(
And also, I am not sure I could write a new IM in a integration with the existing software... this is the other question in my mind.

LizR, as far as I understand, you absolutely did not suggest to save chat-session by reading keyboard, even if I find a way to obey legal issues.

Thaks a lot..
Best Regards..

sivaslieko++ Sep 10th, 2008 4:56 pm
Re: Read keyboard in console application: a special case !
 
Meanwhile,
When I searched through the internet with "c# keylogger" keyword, then it returns lots of results in official sites and forums.
I think its legal issues is related to your purposes. Once you've defined your problem statement and purpose for using keylogger application officially, then it is ok..

What is yours oppinion about that issue?
Best Regards.

Narue Sep 10th, 2008 5:04 pm
Re: Read keyboard in console application: a special case !
 
>What is yours oppinion about that issue?
I think this is identical to discussion of writing a virus for instructional purposes. The direct intention may be benign, but ultimately it's so prone to being used illegally that Daniweb's rules come into play. Thus, discussion of keylogger implementation is prohibited.


All times are GMT -4. The time now is 9:46 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC