Click here to Skip to main content
15,900,724 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I need some help in server

If I want to control computer from another computer through server
and control mouse

I need help if this scenario is correct :

convert control mouse to byte , then send it to server , the server will send this bytes to remote computer
the remote computer will convert this bytes to what , to controlling mouse ?

please I need help
because I don't know any thing about server

thanx
Posted
Comments
Sergey Alexandrovich Kryukov 4-Apr-12 22:04pm    
Not a valid question. The "correct" scenario is something which is not defined as it depends on what you want to achieve and why.
What do you mean "to byte"? No mouse data can fit in one byte... :-)
--SA
maxpower12345 5-Apr-12 10:42am    
ohI know that every thing will go through server will convert to "byte"
that's what I mean about "to byte"
:)

so how can I control mouse from one client to another client through server ?
Sergey Alexandrovich Kryukov 6-Apr-12 1:22am    
That was my guess, but you should have said "bytes" or "array of bytes". You can do it if you write such service. Or look at the advice by Björn Ranft below. It's quite possible, but hard to advise on any advice without knowing your purpose.
--SA
El_Codero 5-Apr-12 16:00pm    
You thought about using RDP-Protocol?I guess you send bytes with mouse coordinates from client/server. Do you already tried to convert it with BitConverter.ToInt32? Using named pipes could be too much for your scenario.Not easy to help without more information.
maxpower12345 6-Apr-12 11:48am    
its my " Graduation Project "
I try to control computer from mobile "windows phone 7"
exactly as "Teamviewer" program

but I have problem in programming "Server" application
how I can send the data "control mouse and keyboard and screenshot" through server ?
I solved the screenshot by convert it from bitmap to byte array
but the mouse and keyboard I don't know how to solve this
while I don't know any thing about server

1 solution

Please see my comments to the question. As you did not share your purpose, it's possible only to give a couple of general ideas.

Nothing can happen if the host to be controlled is not running some service code to respond to commands from other host. Basically, you can create a network service in the form of Windows Service. Please see:
http://en.wikipedia.org/wiki/Windows_Service[^],
http://msdn2.microsoft.com/en-us/library/ms685141.aspx[^].

Please start here: http://msdn.microsoft.com/en-us/library/d56de412%28v=vs.100%29.aspx[^].

You can do networking on several different layers; I overview them in my past answers:
how i can send byte[] to other pc[^],
Communication b/w two Windows applications on LAN.[^].

On the server side, you can control the mouse using the Windows API SendInput, P/Invoked. Please see:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310%28v=vs.85%29.aspx[^],
http://www.pinvoke.net/default.aspx/user32.sendinput[^].

If you still need to learn P/Invoke, please use see:
http://en.wikipedia.org/wiki/PInvoke[^],
http://msdn.microsoft.com/en-us/library/Aa712982[^].

This CodeProject article can also be useful: Essential P/Invoke[^].

Again, hard to say if you can use some more specialized approach without knowing your goals, but pay attention for the advice by Björn Ranft in the comments to the question.

—SA
 
Share this answer
 
Comments
maxpower12345 6-Apr-12 11:50am    
thank you :)
I will study the links
Sergey Alexandrovich Kryukov 8-Apr-12 0:49am    
Are you considering accepting this answer formally (green button)?
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900