Разработка отказоустойчивой вычислительной системы

Курсовой проект - Компьютеры, программирование

Другие курсовые по предмету Компьютеры, программирование

;thenstr:=str+mas[i]elsebreak;end;ifmas[0]=zthenbeginifmas[1]=dthenImage1.Picture.LoadFromFile(d.jpg);ifmas[1]=pthenImage1.Picture.LoadFromFile(p.jpg);ifmas[1]=sthenImage1.Picture.LoadFromFile(s.jpg);ifmas[1]=othenImage1.Picture.LoadFromFile(o.jpg);fori:=2to1000dobeginifmas[i] then str:=str+mas[i] else break; end; timer2.Enabled:=false; end; procedure TForm1.FormCreate(Sender: TObject); begin Mip:=GetLocalIP; c.Host:=eip.Text; numP:=0; ncs:=1; end; procedure TForm1.Button3Click(Sender: TObject); begin if Button3.caption= thenbegin label2.Visible:=false; label3.Visible:=false; label4.Visible:=false; label5.Visible:=false; eip.Visible:=false; eip2.Visible:=false; eport.Visible:=false; Button2.Visible:=false; Memo1.Visible:=false; Form1.Height:=180; button3.Caption:= ; end else begin label2.Visible:=true; label3.Visible:=true; label4.Visible:=true; label5.Visible:=true; eip.Visible:=true; eip2.Visible:=true; eport.Visible:=true; Button2.Visible:=true; Memo1.Visible:=true; Form1.Height:=400; Button3.caption:= ; end end; end.

Код программы сервера:

 

unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs,IdSocketHandle, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdUDPBase, IdUDPClient, ExtCtrls, IdUDPServer, IdTCPServer, jpeg, Buttons, FileCtrl,WinSock; type TForm1 = class(TForm) s: TIdUDPServer; c: TIdUDPClient; Eport: TEdit; Button2: TButton; Edit1: TEdit; nilthenResult:=iNet_ntoa(PInAddr(p^.h_addr_list^)^);end;WSACleanup;end;end;procedureTForm1.sUDPRead(Sender:TObject;AData:TStream;ABinding:TIdSocketHandle);vari:integer;zap:boolean;mas:array[0..1000]ofchar;str,pg:string;beginzap:=false;str:=;Adata.Read(mas,100);fori:=1to1000dobeginifmas[i]! then str:=str+mas[i] elseLabel1: TLabel; Label2: TLabel; Edit2: TEdit; RadioButton1: TRadioButton; RadioButton2: TRadioButton; RadioButton3: TRadioButton; RadioButton4: TRadioButton; Label3: TLabel; Label4: TLabel; function GetLocalIP: String; procedure sUDPRead(Sender: TObject; AData: TStream; ABinding: TIdSocketHandle); procedure Button2Click(Sender: TObject); procedure FormC