Ağ uzerinden veya internetten ıp adresin(Delphi)
//Formumuza 3 Edit, 1 openDialod, 1 saveDialog, 1 Button, 1 NMStrm, 1 NMStrmServ, 1 İmage Ekleyin ve asagıdakı kodları yazın
procedure TForm1.FormCreate(Sender: TObject);
begin
Edit1.text:='127.0.0.1';
edit2.text:='6711';
edit3.text:='Adınızı Giriniz';
NMstrm1.timeout:=90000;
NMStrmServ1.Timeout:=90000;
end;
procedure TForm1.Edit1Change(Sender: TObject);
begin
NMStrm1.host:=edit1.text;
end;
procedure TForm1.Edit2Change(Sender: TObject);
begin
NMstrm1.port:=strtoint(edit2.text);
nmstrmserv1.port:=strtoint(edit2.text);
end;
procedure TForm1.Edit3Change(Sender: TObject);
begin
nmstrm1.fromname:=edit3.text;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Fstrm: TFileStream;
begin
if opendialog1.execute then
begin
FStrm:=TFilestream.create(Opendialog1.Filename, fmopenread);
try
NMStrm1.postit(Fstrm);
finally
FStrm.free;
end;
end;
end;
procedure TForm1.NMStrm1PacketSent(Sender: TObject);
begin
Caption:=inttostr(nmstrm1.bytessent]'/'+ inttostr(nmstrm1.bytestotal);
end;
procedure TForm1.NMStrm1MessageSent(Sender: TObject);
begin
Caption:='Dosya Gonderildi';
end;
procedure TForm1.NMStrmServ1MSG(Sender: TComponent; const sFrom: String;
strm: TStream);
var
fstrm:tfilestream;
begin
Caption:=sfrom+'dan'+inttostr(strm.size]'boyutund a dosya geldi';
if savedialog1.execute then
begin
if fileexists(savedialog1.filename) then
deletefile(savedialog1.filename);
fstrm:=tfilestream.create(savedialog1.filename, fmcreate);
try
fstrm.copyfrom(strm, strm.size);
finally
end;
if lowercase(Extractfileext(savedialog1.filename))='. bmp' then
image1.picture.loadfromfile(savedialog1.filename);
end;
end;
end.
Analog saat(Delphi)
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Min_Check:=min;
Hour_Check:=hour;
tid:=timetostr(time);
ss:= tid[7] +tid[8];
sek:=strtoint(ss);
m:= tid[4] +tid[5];
min:=strtoint(m);
h:= tid[1] +tid[2];
hour:=strtoint(h);
if (min_check min) then
Min_Update:=true;
if (Hour_Check Hour) then
Hour_Update:=true;
form1.Canvas.Pen.Width :=1;
form1.Canvas.pen.Color:=clwhite;
form1.Canvas.LineTo(strtoint(floattostr(oldx)),str toint(floattostr(oldy))) ;
form1.Canvas.LineTo(strtoint(floattostr(midx)),str toint(floattostr(midy))) ;
HourX1 := s * Cos((Pi / 180) * (30 * hour - 90)) + MidX;
HourY1 := s * Sin((Pi / 180) * (30 * hour - 90)) + MidY;
MinX1 := s * Cos((Pi / 180) * (6 * Min - 90)) + MidX;
MinY1 := s * Sin((Pi / 180) * (6 * Min - 90)) + MidY;
X1 := s * Cos((Pi / 180) * (6 * sek - 90)) + MidX;
Y1 := s * Sin((Pi / 180) * (6 * sek - 90)) + MidY ;
x:=int(x1);
y:=int(y1);
OldXMin := XMin ;
OldYMin := YMin ;
XMin:=int(MinX1);
YMin:=int(MinY1);
OldXHour:=XHour;
OldYHour:=YHour;
XHour:=int(HourX1);
YHour:=int(HourY1);
form1.Canvas.pen.Color:=clred;
form1.Canvas.Pen.Width :=1;
form1.Canvas.LineTo(strtoint(floattostr(x)),strtoi nt(floattostr(y))) ;
form1.Canvas.LineTo(strtoint(floattostr(midx)),str toint(floattostr(midy))) ;
OldX := X ;
OldY := Y ;
if (Min_Update=true) then
begin
form1.Canvas.pen.Color:=clwhite;
form1.Canvas.LineTo(strtoint(floattostr(OldXMin)), strtoint(floattostr(OldYMin))) ;
form1.Canvas.LineTo(strtoint(floattostr(MidX)),str toint(floattostr(MidY))) ;
Min_Update:=false;
end;
form1.Canvas.pen.Color:=clblack;
form1.Canvas.LineTo(strtoint(floattostr(XMin)),str toint(floattostr(YMin))) ;
form1.Canvas.LineTo(strtoint(floattostr(MidX)),str toint(floattostr(MidY))) ;
if (Hour_Update=true) then
begin
form1.Canvas.Pen.Width :=3;
form1.Canvas.pen.Color:=clwhite;
form1.Canvas.LineTo(strtoint(floattostr(OldXHour)) ,strtoint(floattostr(OldYHour))) ;
form1.Canvas.LineTo(strtoint(floattostr(MidX)),str toint(floattostr(MidY))) ;
Hour_Update:=false;
end;
form1.Canvas.Pen.Width :=3;
form1.Canvas.pen.Color:=clblack;
form1.Canvas.LineTo(strtoint(floattostr(XHour)),st rtoint(floattostr(YHour))) ;
form1.Canvas.LineTo(strtoint(floattostr(MidX)),str toint(floattostr(MidY))) ;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
form1.Width :=200;
form1.Height:=200;
s := Form1.Width * 0.3;
MidX := 50;
MidY := 50;
form1.Canvas.LineTo(strtoint(floattostr(midx)),str toint(floattostr(midy))) ;
oldx:=midx;
oldy:=midy;
form1.Canvas.Pen.Color :=clblack;
form1.Canvas.Ellipse(0,0,100,100);
form1.Canvas.Pen.Width :=8;
end;
//ekranda sadece akrep yelkoval ve saniye gozukecektir
//saat ler icin ayrı ayrı shape ekleyebilirsiniz
//eğer her saat icin bi shape eklemek isterseninz
// formun wiev as tet kısmına bunları yazmanız gerekmektedir
//tabi shapeleri ekledikden sonra
object Shape2: TShape
Left = 48
Top = 0
Width = 5
Height = 5
Brush.Color = clLime
Shape = stCircle
end
object Shape3: TShape
Left = 0
Top = 48
Width = 5
Height = 5
Brush.Color = clLime
Shape = stCircle
end
object Shape4: TShape
Left = 88
Top = 48
Width = 5
Height = 5
Brush.Color = clLime
Shape = stCircle
end
object Shape5: TShape
Left = 25
Top = 4
Width = 5
Height = 5
Brush.Color = clLime
Shape = stCircle
end
object Shape6: TShape
Left = 69
Top = 85
Width = 5
Height = 5
Brush.Color = clLime
Shape = stCircle
end
object Shape7: TShape
Left = 85
Top = 70
Width = 5
Height = 5
Brush.Color = clLime
Shape = stCircle
end
object Shape8: TShape
Left = 48
Top = 88
Width = 5
Height = 5
Brush.Color = clLime
Shape = stCircle
end
object Shape9: TShape
Left = 6
Top = 70
Width = 5
Height = 5
Brush.Color = clLime
Shape = stCircle
end
object Shape10: TShape
Left = 5
Top = 24
Width = 5
Height = 5
Brush.Color = clLime
Shape = stCircle
end
object Shape11: TShape
Left = 69
Top = 4
Width = 5
Height = 5
Brush.Color = clLime
Shape = stCircle
end
object Shape12: TShape
Left = 25
Top = 85
Width = 5
Height = 5
Brush.Color = clLime
Shape = stCircle
end
object Shape13: TShape
Left = 86
Top = 24
Width = 5
Height = 5
Brush.Color = clLime
Shape = stCircle
end
object Shape14: TShape
Left = 48
Top = 48
Width = 5
Height = 5
Brush.Color = clRed
Shape = stCircle
end
Form acılışına şifre koymak(Delphi)
// Formun oncreate olayına...
procedure TForm1.FormCreate(Sender: TObject);
var
x,b:string;
begin
b:='Buraya şifre giriniz';
x:=inputbox('Programa Giriş','Programa girmek icin şifreyi Giriniz:','');
if x=b then
application.messagebox('Programa Girişiniz Onaylandı.Tebrikler ..!','Tebrikler',mb_ok+mb_defbutton1)
else
halt;
end;
end.
Animasyonlu form acilisi(Delphi)
kodu istediğiniz yere yazabilirsiniz.
animatewindow(handle,500,aw_center);
kod bu arkadaşlar.
500: kac milisaniyede gelsin isterseniz...
aw_center: buraya nasıl gelsin isterseniz onu yazın..
yani "aw_" yazın ctrl+space yapın orada neler yazılabilir gorursunuz..
ayrıca aralarına or operatoru kullanabilirsiniz..
animatewindow(handle,500,aw_ver_positive or aw_ver_negative or aw_center);
falan gibi yani..
__________________
Delphi Ornek programlar
Delphi0 Mesaj
●43 Görüntüleme
- ReadBull.net
- Programlama ve Yazılım
- Programlama Dilleri
- Delphi
- Delphi Ornek programlar