IdRexec.pas 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. {
  2. $Project$
  3. $Workfile$
  4. $Revision$
  5. $DateUTC$
  6. $Id$
  7. This file is part of the Indy (Internet Direct) project, and is offered
  8. under the dual-licensing agreement described on the Indy website.
  9. (http://www.indyproject.org/)
  10. Copyright:
  11. (c) 1993-2005, Chad Z. Hower and the Indy Pit Crew. All rights reserved.
  12. }
  13. {
  14. $Log$
  15. }
  16. {
  17. Rev 1.2 1/21/2004 3:27:18 PM JPMugaas
  18. InitComponent
  19. Rev 1.1 4/4/2003 8:02:58 PM BGooijen
  20. made host published
  21. Rev 1.0 11/13/2002 07:59:46 AM JPMugaas
  22. -2001.05.18 - J. Peter Mugaas
  23. I removed the property for forcing client ports
  24. into a specific range. This was not necessary
  25. for Rexec. It is required for the TIdRSH Component
  26. -2001.02.15 - J. Peter Mugaas
  27. I moved most of the Rexec code to
  28. TIdRemoteCMDClient and TIdRexec now inherits
  29. from that class. This change was necessary to
  30. reduce duplicate code with a new addition, IdRSH.
  31. -2001.02.14 - J. Peter Mugaas
  32. Made it more complient with Rexec servers
  33. and handled the #0 or error indicator
  34. -2001.02.13 - Modified by Kudzu
  35. -2000.10.24 - Original Author: Laurence LIew
  36. }
  37. unit IdRexec;
  38. {
  39. Indy Rexec Client TIdRexec
  40. Copyright (C) 2001 Winshoes Working Group
  41. Original author Laurence LIew
  42. 2000-October-24
  43. }
  44. interface
  45. {$i IdCompilerDefines.inc}
  46. uses
  47. IdAssignedNumbers,
  48. IdRemoteCMDClient,
  49. IdTCPClient;
  50. type
  51. TIdRexec = class(TIdRemoteCMDClient)
  52. protected
  53. procedure InitComponent; override;
  54. public
  55. Function Execute(ACommand: String): String; override;
  56. published
  57. property Username;
  58. property Password;
  59. property Port default Id_PORT_exec;
  60. property Host;
  61. end;
  62. implementation
  63. uses
  64. IdComponent,
  65. IdGlobal,
  66. IdThread;
  67. procedure TIdRexec.InitComponent;
  68. begin
  69. inherited;
  70. Port := Id_PORT_exec;
  71. {Rexec does not require ports to be in a specific range}
  72. FUseReservedPorts := False;
  73. end;
  74. function TIdRexec.Execute(ACommand: String): String;
  75. begin
  76. Result := InternalExec(UserName,Password,ACommand);
  77. end;
  78. end.