IdRSH.pas 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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.3 2004.02.03 5:44:16 PM czhower
  18. Name changes
  19. Rev 1.2 2004.01.22 5:58:54 PM czhower
  20. IdCriticalSection
  21. Rev 1.1 1/21/2004 3:27:22 PM JPMugaas
  22. InitComponent
  23. Rev 1.0 11/13/2002 07:59:56 AM JPMugaas
  24. -2001.02.15 - J. Peter Mugaas
  25. Started this unit
  26. }
  27. unit IdRSH;
  28. {
  29. Indy Execute Client TIdRSH
  30. Copyright (C) 2001 Indy Pit Crew
  31. Original author J. Peter Mugaas
  32. 2001-February-15
  33. }
  34. interface
  35. {$i IdCompilerDefines.inc}
  36. uses
  37. IdAssignedNumbers, IdGlobal, IdRemoteCMDClient, IdTCPClient;
  38. type
  39. TIdRSH = class(TIdRemoteCMDClient)
  40. protected
  41. FClientUserName : String;
  42. FHostUserName : String;
  43. procedure InitComponent; override;
  44. public
  45. Function Execute(ACommand: String): String; override;
  46. published
  47. property ClientUserName : String read FClientUserName write FClientUserName;
  48. property Host;
  49. property HostUserName : String read FHostUserName write FHostUserName;
  50. property Port default IdPORT_cmd;
  51. property UseReservedPorts: Boolean read FUseReservedPorts write FUseReservedPorts
  52. default IDRemoteFixPort;
  53. end;
  54. implementation
  55. uses
  56. IdComponent,
  57. IdGlobalProtocols,
  58. IdThread;
  59. { TIdRSH }
  60. procedure TIdRSH.InitComponent;
  61. begin
  62. inherited;
  63. Port := IdPORT_cmd;
  64. FClientUserName := ''; {Do not Localize}
  65. FHostUserName := ''; {Do not Localize}
  66. end;
  67. function TIdRSH.Execute(ACommand: String): String;
  68. begin
  69. Result := InternalExec(FClientUserName,FHostUserName,ACommand);
  70. end;
  71. end.