IdQotd.pas 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 1/21/2004 3:27:12 PM JPMugaas
  18. InitComponent
  19. Rev 1.2 12/8/2002 07:25:44 PM JPMugaas
  20. Added published host and port properties.
  21. Rev 1.1 12/6/2002 05:30:28 PM JPMugaas
  22. Now decend from TIdTCPClientCustom instead of TIdTCPClient.
  23. Rev 1.0 11/13/2002 07:58:34 AM JPMugaas
  24. }
  25. unit IdQotd;
  26. {*******************************************************}
  27. { }
  28. { Indy QUOTD Client TIdQOTD }
  29. { }
  30. { Copyright (C) 2000 Winshoes WOrking Group }
  31. { Started by J. Peter Mugaas }
  32. { 2000-April-23 }
  33. { }
  34. {*******************************************************}
  35. interface
  36. {$i IdCompilerDefines.inc}
  37. uses
  38. IdAssignedNumbers,
  39. IdTCPClient;
  40. type
  41. TIdQOTD = class(TIdTCPClientCustom)
  42. protected
  43. Function GetQuote: String;
  44. procedure InitComponent; override;
  45. public
  46. { This is the quote from the server }
  47. Property Quote: String read GetQuote;
  48. published
  49. Property Port default IdPORT_QOTD;
  50. property Host;
  51. end;
  52. implementation
  53. { TIdQotd }
  54. procedure TIdQOTD.InitComponent;
  55. begin
  56. inherited;
  57. Port := IdPORT_QOTD;
  58. end;
  59. function TIdQOTD.GetQuote: String;
  60. begin
  61. Result := ConnectAndGetAll;
  62. end;
  63. end.