• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 157
  • Last Modified:

can you answer me about client/server???

What I want to do is to implement some kind of client/server in my project
the problem is how can I implement the full control between two computers
in Delphi
the server can “print the client server,open the CD-drive … ”
0
xfaresx
Asked:
xfaresx
1 Solution
 
nestoruaCommented:
HI,
You can use for example TClientSocket/TServerSocket components. You send from the Client the message with corresponding command and the server program execute that command. That's all.
Sincerely,
Nestorua.
0
 
JoshjjeCommented:
Yea, add the TClientSocket to your client program.  Add all the information to it (Host and Port) then use ClientSocket1.Open; to initiate the connection.  On the server program add the TServerSocket set Port, then use ServerSocket1.Open; to wait for the client to connect.  

Now to send data you would use ClientSocket1.Socket.SendText('some data');  Thats how you can send your commands to the server.

Now your server would have to recieve the text and then interpret it to do what you wish.  You would have to use the ServerSocket OnClientRead event (ServerSocketClientRead).  To say add the received data to a memo you would do:

procedure TForm1.ServerSocketClientRead(Sender: TObject;
  Socket: TCustomWinSocket);
begin
  Memo1.Lines.Add(Socket.ReceiveText);
end;

Socket.ReceiveText will return the text sent to it by the client.

If you need a more indepth explanation tell me.
0
 
Wax0rCommented:
Seeing as you seem to be steering for some sort of RAT utility you might want to have a go at a bit of a personal protocol thing, such as:

msg:This would popup a message with this content
cdr:open  - this would open the cdrom drive
cdr:close - this would close the cdrom drive

To keep things easy you could do it UDP so you don't have to worry about making a connection before sending any data but having said that, TCP -is- the better choice as UDP is vulnerable to (possible!) packet loss.

Any other questions feel free to ask.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
CleanupPingCommented:
xfaresx:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
snehanshuCommented:
Hi!
No comment has been added lately and this question is therefore classified abandoned.

If asker wishes to close the question, then refer to
http://www.experts-exchange.com/help/closing.jsp

Otherwise, I will leave a recommendation in the Cleanup topic area that this question is:

Answered by: Joshjje

Please leave any comments here within the next seven days. It is assumed that any participant not responding to this request is no longer interested in its final disposition.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

...Snehanshu
EE Cleanup Volunteer
0
 
Computer101Commented:
Forced accept

Computer101
E-E Admin
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now