Bilgisayar ve İnternet
Medula İlaç Fiyatı Sorgulama Delphi Kodları (IlacAraGirisDVO)
Öncelikle projenize File – New -Other menüsünden Web Services sekmesinden WSDL İmporter seçerek açılan ekrana Medula yardımcı işlemler web servisinin linkini yapıştırıyoruz. Next i tıklayıp işlemi tamamlıyoruz. Yardımcı islemler1 uniti projemize ekleniyor. bu aşamadan sonra aşağıdaki kod ile sorrguyu tamamlayabilirsiniz. Formumuza Komponent çubuğu web servis sekmesinden SOAP nesnesi ekliyoruz. Nesne ismi (Name) kodumuzda Yardımcı olarak [...]
Açılış Formu, Splash Form Oluşturmak
Programlarınız açılırken bir form getirin. Splash Screen nasıl yapılır? Project Source’u açın. Eğer bir çok form kullanıyorsanız projenizde Application.CreateForm(TForm2, Form2); satırından sonra diğer formları da aynen form2 gibi yaratın. Ve bir alt satırına ekleyin: Application.CreateForm(Tform3, Form3); /gibi… name:form1 /SplashScreen olarak kullanılacak form name:form2 /Ana formumuz. View|Project Source (View menüsünden Project Source seçeneğini seçerek açabilirsiniz.) Daha [...]
Bilgisayarın Ne kadar süredir açık olduğunu bulmak
Bilgisayarın ne zamandan beri açık olduğunu anlamakfunction Uptime: string; var count, days, min, hours, seconds : longint; begin Count := GetTickCount(); Count := Count div 1000; Days := Count div (24 * 3600); if Days > 0 then Count := Count – (24 * 3600 * Days); Hours := Count div 3600; if Hours > [...]
Bir programın sürüm bilgisini almak
procedure versionbul(const AppName: string; var V1, V2, V3, V4: Word); var VerInfoSize, VerValueSize, Dummy : DWORD; VerInfox : Pointer; VerVal : PVSFixedFileInfo; begin VerInfoSize := GetFileVersionInfoSize(PChar(AppName), Dummy); GetMem(VerInfox , VerInfoSize); GetFileVersionInfo(PChar(AppName), 0, VerInfoSize, VerInfox); VerQueryValue(VerInfox, ‘\’, Pointer(VerVal), VerValueSize); with VerVal^ do begin V1 := dwFileVersionMS shr 16; V2 := dwFileVersionMS and $FFFF; V3 := dwFileVersionLS [...]
Prosedür ile Yaş Hesaplama
procedure TEvlenmeMernisForm.YasHesabi(); var TARIH,BUGUN:TDateTime; GUN1,AY1,YIL1,GUN2,AY2,YIL2:word; GUN,AY:integer; begin BUGUN:=Date; TARIH:=MSBelgeler.fieldbyname(‘KBDOGUMTARIHI’).AsDateTime; DecodeDate(BUGUN, YIL1, AY1, GUN1); DecodeDate(TARIH, YIL2, AY2, GUN2); YIL:=YIL1 – YIL2; AY :=AY1 – AY2; if AY < 0 then begin AY :=AY+12; YIL:=YIL-1; end; GUN :=GUN1 – GUN2; if GUN<0 then begin GUN:=GUN+30; AY:=AY-1; end; if AY<0 then begin AY:=AY+12; YIL:=YIL-1; end; if MSBelgeler.FieldByName(‘ABCINSIYET’).AsString=’True’ THEN [...]
Delphi de Ekran Klavyesi Yazmak
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids; type TForm1 = class(TForm) DrawGrid1: TDrawGrid; procedure DrawGrid1DrawCell(Sender: TObject; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState); procedure DrawGrid1SelectCell(Sender: TObject; ACol, ARow: Integer; var CanSelect: Boolean); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R [...]
Her Yönüyle Delphi ve Excell Kontrolü
Başlıktanda anlayacağınız gibi Her yönü ile delphi ve excel Uses satırına eklenecek ComObj Değişkenlerimi tanımlayalım var XLApp : OleVariant; ColonAraligi : OleVariant; const alignCenter = -4108; valignCenter = -4108; alignRight =- 4152; Excel Kontrolu try XLApp := GetActiveOleObject(‘Excel.Application’); except try XLApp := CreateOleObject(‘Excel.Application’); except ShowMessage(‘Excel kurulu değil’); Exit; end; end; Var olan br excel’i açma [...]
Programa Güvenlik Klidi Koymak
procedure TForm1.FormCreate(Sender: TObject);beginedit1.Text:=”;hata:=0;assignfile(dsy,’c:\basri.dat’);{$i-}reset(dsy);{$i+}if ioresult<>0 then rewrite(dsy);for i:=0 to filesize(dsy)-1 do beginseek(dsy,i);read(dsy,a);if a.kilit=’*’then beginshowmessage(‘kilitli’);halt;end;end;end; procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);beginif ord(key)=13 then beginsifre:=’basri’;if edit1.Text<>sifre then beginhata:=hata+1;edit1.Text:=”;endelse if edit1.Text=sifre then beginform2.Show;end;if hata>=3 then begina.kilit:=’*’;seek(dsy,filesize(dsy));write(dsy,a);halt;end;end;end; Alıntıdır. Etiketler : programa güvenlik kilidi, güvenlik kilidi, yazılım koruma , yazılım güvenliği , program güvenliği, lisans uygulaması, delphi ile yazılım lisansı, delphi [...]
Listbox ta Otomatik boyutlandırma işlemi
unit MutliLineListBox; interface uses Windows, Graphics, Messages, SysUtils, Classes, Controls, StdCtrls; type TMutliLineListBox = class(TListBox) private { Private declarations } FMultiLine: Boolean; procedure SetMultiLine(const Value: Boolean); protected { Protected declarations } procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override; procedure MeasureItem(Index: Integer; var Height: Integer); override; public { Public declarations } published { Published declarations [...]
Zlib Kullanarak Dosya Sıkıştırma
uses ZLib; { Compress a stream } procedure CompressStream(inpStream, outStream: TStream); var InpBuf, OutBuf: Pointer; InpBytes, OutBytes: Integer; begin InpBuf := nil; OutBuf := nil; try GetMem(InpBuf, inpStream.Size); inpStream.Position := 0; InpBytes := inpStream.Read(InpBuf^, inpStream.Size); CompressBuf(InpBuf, InpBytes, OutBuf, OutBytes); outStream.Write(OutBuf^, OutBytes); finally if InpBuf <> nil then FreeMem(InpBuf); if OutBuf <> nil then FreeMem(OutBuf); end; [...]
