Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 2.42 KB | None | 0 0
  1. unit Unit2;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, ExtCtrls, StdCtrls;
  8.  
  9. type
  10.   TForm2 = class(TForm)
  11.     Button1: TButton;
  12.     Label1: TLabel;
  13.     Label2: TLabel;
  14.     Label3: TLabel;
  15.     Label4: TLabel;
  16.     Label5: TLabel;
  17.     Edit1: TEdit;
  18.     Edit2: TEdit;
  19.     Edit3: TEdit;
  20.     Edit4: TEdit;
  21.     Edit5: TEdit;
  22.     Panel1: TPanel;
  23.     Panel2: TPanel;
  24.     Label6: TLabel;
  25.     Label7: TLabel;
  26.     Label8: TLabel;
  27.     Edit6: TEdit;
  28.     Edit7: TEdit;
  29.     Edit8: TEdit;
  30.     procedure FormCreate(Sender: TObject);
  31.     procedure Button1Click(Sender: TObject);
  32.     procedure OnClose(Sender: TObject);
  33.   private
  34.     { Private declarations }
  35.   public
  36.     { Public declarations }
  37.   end;
  38.  
  39. var
  40.   Form2: TForm2;
  41.   config: text;
  42.   server: string;
  43.   from: string;
  44.   _to: string;
  45.   subject: string;
  46.   content: string;
  47.   _from: string;
  48.   __to: string;
  49.   _subject: string;
  50. implementation
  51.  
  52. {$R *.dfm}
  53.  
  54. procedure TForm2.FormCreate(Sender: TObject);
  55. begin
  56. AssignFile(config,'fakemail.cfg');
  57. reset(config);
  58. readln(config,server);
  59. readln(config,from);
  60. readln(config,_to);
  61. readln(config,subject);
  62. readln(config,content);
  63. readln(config,_from);
  64. readln(config,__to);
  65. readln(config,_subject);
  66. Edit1.Text:=server;
  67. Edit2.Text:=from;
  68. Edit3.Text:=_to;
  69. Edit4.Text:=subject;
  70. Edit5.Text:=content;
  71. Edit6.Text:=_from;
  72. Edit7.Text:=__to;
  73. Edit8.Text:=_subject;
  74. CloseFile(config);
  75. end;
  76.  
  77. procedure TForm2.Button1Click(Sender: TObject);
  78. begin
  79.   rewrite(config);
  80.   server:=Edit1.Text;
  81.   from:=Edit2.Text;
  82.   _to:=Edit3.Text;
  83.   subject:=Edit4.Text;
  84.   content:=Edit5.Text;
  85.   _from:=Edit6.Text;
  86.   __to:=Edit7.Text;
  87.   _subject:=Edit8.Text;
  88.   writeln(config,server);
  89.   writeln(config,from);
  90.   writeln(config,_to);
  91.   writeln(config,subject);
  92.   writeln(config,content);
  93.   writeln(config,_from);
  94.   writeln(config,__to);
  95.   writeln(config,_subject);
  96.   CloseFile(config);
  97. end;
  98. procedure TForm2.OnClose(Sender: TObject);
  99. begin
  100.   rewrite(config);
  101.   server:=Edit1.Text;
  102.   from:=Edit2.Text;
  103.   _to:=Edit3.Text;
  104.   subject:=Edit4.Text;
  105.   content:=Edit5.Text;
  106.   _from:=Edit6.Text;
  107.   __to:=Edit7.Text;
  108.   _subject:=Edit8.Text;
  109.   writeln(config,server);
  110.   writeln(config,from);
  111.   writeln(config,_to);
  112.   writeln(config,subject);
  113.   writeln(config,content);
  114.   writeln(config,_from);
  115.   writeln(config,__to);
  116.   writeln(config,_subject);
  117.   CloseFile(config);
  118. end;
  119. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement