Programlama yapalım ve Öğrenelim. - Delphi Eğitim106
  Ana Sayfa
  .NET Eğitim Notları
  Visual C# .NET Örnek Kodları
  VisualBasic.NET Örnek Kodları
  J# Örnekleri
  ASP.NET Örnek Kodları
  Delphi Eğitim
  => Delphi Eğitim1
  => Delphi Eğitim2
  => Delphi Eğitim3
  => Delphi Eğitim4
  => Delphi Eğitim5
  => Delphi Eğitim6
  => Delphi Eğitim7
  => Delphi Eğitim8
  => Delphi Eğitim9
  => Delphi Eğitim10
  => Delphi Eğitim11
  => Delphi Eğitim13
  => Delphi Eğitim14
  => Delphi Eğitim15
  => Delphi Eğitim16
  => Delphi Eğitim17
  => Delphi Eğitim18
  => Delphi Eğitim19
  => Delphi Eğitim20
  => Delphi Eğitim21
  => Delphi Eğitim22
  => Delphi Eğitim23
  => Delphi Eğitim24
  => Delphi Eğitim25
  => Delphi Eğitim26
  => Delphi Eğitim27
  => Delphi Eğitim28
  => Delphi Eğitim29
  => Delphi Eğitim30
  => Delphi Eğtim31
  => Delphi Eğitim32
  => Delphi Eğitim33
  => Delphi Eğitim34
  => Delphi Eğitim35
  => Delphi Eğitim36
  => Delphi Eğitim37
  => Delphi Eğitim38
  => Delphi Eğitim39
  => Delphi Eğitim40
  => Delphi Eğitim41
  => Delphi Eğitim42
  => Delphi Eğitim43
  => Delphi Eğitim44
  => Delphi Eğitim45
  => Delphi Eğitim46
  => Delphi Eğitim47
  => Delphi Eğitim48
  => Delphi Eğitim49
  => Delphi Eğitim50
  => Delphi Eğitim51
  => Delphi Eğitim52
  => Delphi Eğitim53
  => Delphi Eğitim54
  => Delphi Eğitim55
  => Delphi Eğitim56
  => Delphi Eğitim57
  => Delphi Eğitim58
  => Delphi Eğitim59
  => Delphi Eğitim60
  => Delphi Eğitim61
  => Delphi Eğitim62
  => Delphi Eğitim63
  => Delphi Eğitim64
  => Delphi Eğitim65
  => Delphi Eğitim66
  => Delphi Eğitim67
  => Delphi Eğitim68
  => Delphi Eğitim69
  => Delphi Eğitim70
  => Delphi Eğitim71
  => Delphi Eğitim72
  => Delphi Eğitim73
  => Delphi Eğitim74
  => Delphi Eğitim75
  => Delphi Eğitim76
  => Delphi Eğitim77
  => Delphi Eğitim78
  => Delphi Eğitim79
  => Delphi Eğitim80
  => Delphi Eğitim81
  => Delphi Eğitim82
  => Delphi Eğitim83
  => Delphi Eğitim84
  => Delphi Eğitim85
  => Delphi Eğitim86
  => Delphi Eğitim87
  => Delphi Eğitim88
  => Delphi Eğitim89
  => Delphi Eğitim90
  => Delphi Eğitim91
  => Delphi Eğitim92
  => Delphi Eğitim93
  => Delphi Eğitim94
  => Delphi Eğitim95
  => Delphi Eğitim96
  => Delphi Eğitim97
  => Delphi Eğitim98
  => Delphi Eğitim99
  => Delphi Eğitim100
  => Delphi Eğitim101
  => Delphi Eğitim102
  => Delphi Eğitim103
  => Delphi Eğitim104
  => Delphi Eğitim105
  => Delphi Eğitim106
  => Delphi Eğitim107
  => Delphi Eğitim108
  => Delphi Eğitim109
  => Delphi Eğitim110
  => Delphi Eğitim111
  => Delphi Eğitim112
  => Delphi Eğitim113
  => Delphi Eğitim114
  => Delphi Eğitim115
  => Delphi Eğitim116
  => Delphi Eğitim117
  => Delphi Eğitim118
  => Delphi Eğitim119
  => Delphi Eğitim120
  => Delphi Eğitim121
  => Delphi Eğitim122
  => Delphi Eğitim123
  => Delphi Eğitim124
  => Delphi Eğitim125
  => Delphi Eğitim126
  => Delphi Eğitim127
  => Delphi Eğitim128
  => Delphi Eğitim129
  => Delphi Eğitim130
  => Delphi Eğitim131
  => Delphi Eğitim132
  => Delphi Eğitim133
  => Delphi Eğitim134
  => Delphi Eğitim135
  => Delphi Eğitim136
  => Delphi Eğitim137
  => Delphi Eğitim138
  => Delphi Eğitim139
  => Delphi Eğitim140
  => Delphi Eğitim141
  => Delphi Eğitim142
  => Delphi Eğitim143
  => Delphi Eğitim144
  => Delphi Eğitim145
  => Delphi Eğitim146
  => Delphi eğitim147
  => Delphi Eğitim148
  => Delphi Eğitim149
  => Delphi Eğitim150
  => Delphi Eğitim151
  => Delphi Eğitim152
  => Delphi Eğitim153
  => Delphi Eğitim154
  => Delphi Eğitim155
  => Delphi Eğitim156
  => Delphi Eğitim157
  => Delphi Eğitim158
  => Delphi Eğitim159
  => Delphi Eğitim160
  => Delphi Eğitim161
  => Delphi Eğitim162
  => Delphi Eğitim164
  => Delphi Eğitim165
  => Delphi Eğitim166
  => Delphi Eğitim167
  => Delphi Eğitim168
  => Delphi Eğitim169
  => Delphi Eğitim170
  => Delphi Eğitim171
  => Delphi Eğitim172
  => Delphi Eğitim173
  => Delphi Eğitim174
  => Delphi Eğitim175
  => Delphi Eğitim176
  => Delphi Eğitim177
  => Delphi Eğitim178
  => Delphi Eğitim179
  => Delphi Eğitim180
  => Delphi Eğitim181
  => Delphi Eğitim182
  => Delphi Eğitim183
  => Delphi Eğitim184
  => Delphi Eğitim185
  => Delphi Eğitim186
  => Delphi Eğitim187
  => Delphi Eğitim188
  => Delphi Eğitim189
  => Delphi Eğitim190
  => Delphi Eğitim191
  => Delphi Eğitim192
  => Delphi Eğitim193
  => Delphi Eğitim194
  => Delphi Eğitim195
  => Delphi Eğitim196
  => Delphi Eğitim197
  => Delphi Eğitim198
  => Delphi Eğitim199
  => Delphi Eğitim200
  => Delphi Eğitim201
  => Delphi Eğitim202
  => Delphi Eğitim203
  => Delphi Eğitim204
  => Delphi Eğitim205
  => Delphi Eğitim206
  => Delphi Eğitim207
  => Delphi Eğitim208
  => Delphi Eğitim209
  => Delphi Eğitim210
  => Delphi Eğitim211
  => Delphi Eğitim212
  => Delphi Eğitim213
  => Delphi Eğitim214
  => Delphi Eğitim215
  => Delphi Eğitim216
  => Delphi Eğitim217
  => Delphi Eğitim218
  => Delphi Eğitim219
  => Delphi Eğitim220
  => Delphi Eğitim221
  => Delphi Eğitim222
  => Delphi Eğitim223
  => Delphi Eğitim224
  => Delphi Eğitim225
  => Delphi Eğitim226
  => Delphi Eğitim227
  => Delphi Eğitim228
  => Delphi Eğitim229
  => Delphi Eğitim230
  => Delphi Eğitim231
  => Delphi Eğitim232
  => Delphi Eğitim233
  => Delphi Eğitim234
  => Delphi Eğitim235
  => Delphi Eğitim236
  => Delphi Eğitim237
  => Delphi Eğitim238
  => Delphi Eğitim239
  => Delphi Eğitim240
  => Delphi Eğitim241
  => Delphi Eğitim242
  İletişim

WakeOn Lan

WakeOnLan('00-D0-B7-E2-A1-A0');

Answer:

 

 

uses idUDPClient;

 

// ==========================================================================

// Wakes a machine on lan

// AMacAddress is 17 char MAC address.

// eg.  '00-C0-4F-0A-3A-D7'

// ==========================================================================

 

procedure WakeOnLan(const AMacAddress : string);

type

     TMacAddress = array [1..6] of byte;

 

     TWakeRecord = packed record

       Waker : TMACAddress;

       MAC   : array[0..15] of TMACAddress;

     end;

 

var i : integer;

    WR : TWakeRecord;

    MacAddress : TMacAddress;

    UDP : TIdUDPClient;

    sData : string;

begin

  // Convert MAC string into MAC array

  fillchar(MacAddress,SizeOf(TMacAddress),0);

  sData := trim(AMacAddress);

 

  if length(sData) = 17 then begin

    for i := 1 to 6 do begin

      MacAddress[i] := StrToIntDef('$' + copy(sData,1,2),0);

      sData := copy(sData,4,17);

    end;

  end;

 

  for i := 1 To 6 do WR.Waker[i] := $FF;

  for i := 0 to 15 do WR.MAC[i] := MacAddress;

  // Create UDP and Broadcast data structure

  UDP := TIdUDPClient.Create(nil);

  UDP.Host := '255.255.255.255';

  UDP.Port := 32767;

  UDP.BroadCastEnabled := true;

  UDP.SendBuffer(WR,SizeOf(TWakeRecord));

  UDP.BroadcastEnabled := false;

  UDP.Free;

end;

 

Delphi - .....................................

 

slm arkadaşlar sms programı hakkında desteklerinizi bekliyorum

ben bilgisayar programcılıgı 2.sınıf ögrencisiyim yapacagım bi adres defteri programında sms atan ve telle arama işlevi olması gerek nasıl yapıcam bilmiyorum:(

 

Delphi - .....................................

 

slm arkadaşlar sms programı hakkında desteklerinizi bekliyorum

ben bilgisayar programcılıgı 2.sınıf ögrencisiyim yapacagım bi adres defteri programında sms atan ve telle arama işlevi olması gerek nasıl yapıcam bilmiyorum:(

 

Delphi - .....................................

 

arkadaşlar m.ü bilg.ögrencisiyim yaptıgım bi proje için acilen sms gönderen delphi programı lazım ya

yardımlarınızı bekliyorum!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

 

Delphi - .....................................

 

arkadaşlar m.ü bilg.ögrencisiyim yaptıgım bi proje için acilen sms gönderen delphi programı lazım ya

yardımlarınızı bekliyorum!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

 

Delphi - .....................................

 

arkadaşlar m.ü bilg.ögrencisiyim yaptıgım bi proje için acilen sms gönderen delphi programı lazım ya

yardımlarınızı bekliyorum!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

 

Delphi - .....................................

 

arkadaşlar m.ü bilg.ögrencisiyim yaptıgım bi proje için acilen sms gönderen delphi programı lazım ya

yardımlarınızı bekliyorum!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

 

Delphi - .....................................

 

arkadaşlar m.ü bilg.ögrencisiyim yaptıgım bi proje için acilen sms gönderen delphi programı lazım ya

yardımlarınızı bekliyorum!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

 

Delphi - .....................................

 

arkadaşlar m.ü bilg.ögrencisiyim yaptıgım bi proje için acilen sms gönderen delphi programı lazım ya

yardımlarınızı bekliyorum!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

 

Delphi - .....................................

 

arkadaşlar m.ü bilg.ögrencisiyim yaptıgım bi proje için acilen sms gönderen delphi programı lazım ya

yardımlarınızı bekliyorum!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

 

Delphi - .....................................

 

arkadaşlar m.ü bilg.ögrencisiyim yaptıgım bi proje için acilen sms gönderen delphi programı lazım ya

yardımlarınızı bekliyorum!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

 

Delphi - .....................................

 

Form basliginsa saat goruntulenmesi .NET

// asagidaki 4 satirda ayni isi yapar

 

procedure TWinForm.Timer1_Tick(sender: System.Object; e: System.EventArgs);

var t:DateTime;

begin

   self.Text:=t.Now.ToString;

//  self.Text:=convert.ToString(t.now);

//  TWinForm.get_ActiveForm.Text:=t.Now.ToString;

//  twinform.get_ActiveForm.Text:=convert.ToString(t.Now);

end;

 

Delphi.NET - .....................................

 

Web login ve kullanici yetkileri

//Oncelikle web.config dosyasinda islem yapiyoruz

//Not: web.config dosyasinda buyuk-kucuk harf ayrimi vardir

//<allow users="*" /> satirini

  <deny users="?" />

//seklinde degistirdikten sonra

//<authentication mode="Windows" />  satirini silerek yerine asagidaki kodu eliyoruz.

<authentication mode="Forms" >

 <forms name="aknet" loginUrl="webform1.aspx" protection="All">

   <credentials passwordFormat="Clear">

        <user name="deneme" password="deneme"/>

        <user name="abc" password="123"/>

      <user name="admin" password="admin"/>

   </credentials>

 </forms>

</authentication>

// ekliyoruz. web.config dosyasi bu kadar.

/////////////////////////////////////////////////////

webform1.aspx

/////////////////////////////////////////////////////

// uses System.web.Security ile birlikte webforma 2 textbox 1 button

// butonun click olayina

if FormsAuthentication.Authenticate(textbox1.text, textbox2.text) Then

            FormsAuthentication.RedirectFromLoginPage(textbox1.text, False)

        Else

            Response.Write('yanlış parola');

/////////////////////////////////////////////////////

default.aspx

////////////////////////////////////////////////////

// uses System.web.Security ve webformun page_load olayina

if user.Identity.Name='admin' then Response.Write('Admin mod')  else Response.Write('kullanıcı modu');

// admin yada kullanici modunu yazdirdim bunu gelistirerek

// kullanici yetkisine gore islemler yaptirabilirsiniz

 

Delphi.NET - .....................................

 

Kullanıcı adı,şifre isteyen ve 3 girmeden sonra otomatik kapanan program

Form üzerine iki adet edit ve bir adet button alalım ve aşşadaki kodları yazalım

 

var adet:byte;

procedure TForm1.Button1Click(Sender: TObject);

begin

 if (Edit1.Text='İstediğiniz Kullancı Adını yazın') and (Edit.Text='İstediğiniz Şifreyi yazın') then

  begin

   ShowMessage('ŞİFRE DOĞRU');

   close;

  end

 else

   ShowMessage('ŞİFRE YANLIŞ');

  adet:=adet+1;

 if adet>=3 then

 close;

end;

 

Delphi - .....................................

 

Kullanıcı adı,şifre isteyen ve 3 girmeden sonra otomatik kapanan program

Form üzerine iki adet edit ve bir adet button alalım ve aşşadaki kodları yazalım

 

var adet:byte;

procedure TForm1.Button1Click(Sender: TObject);

begin

 if (Edit1.Text='İstediğiniz Kullancı Adını yazın') and (Edit.Text='İstediğiniz Şifreyi yazın') then

  begin

   ShowMessage('ŞİFRE DOĞRU');

   close;

  end

 else

   ShowMessage('ŞİFRE YANLIŞ');

  adet:=adet+1;

 if adet>=3 then

 close;

end;

 

Delphi - .....................................

 

Formda Saatin görünmesi

Herkeze Merhabalar bu benim ilk palyaşım kodum.Umarım anlaşılır bir dilde yazmışımdır

 

Forma bir adet Timer ve bir adet Label alalım

Label'in Caption bölümü boş kalsın.

--------------------------------------------------

procedure TForm1.Timer1Timer(Sender:TObject);

begin

Label1.Caption:=TimeToStr(time);

end;

 

Delphi - .....................................

 

Formda Saatin görünmesi

Herkeze Merhabalar bu benim ilk palyaşım kodum.Umarım anlaşılır bir dilde yazmışımdır

 

Forma bir adet Timer ve bir adet Label alalım

Label'in Caption bölümü boş kalsın.

--------------------------------------------------

procedure TForm1.Timer1Timer(Sender:TObject);

begin

Label1.Caption:=TimeToStr(time);

end;

 

Delphi - .....................................

 

Delhi bir sanattır

Delhi bir sanattır

 

Delphi - .....................................

 

Delhi bir sanattır

Delhi bir sanattır

 

Delphi - .....................................

 

ASP.NET session ile basit bir login

webforma 1 buton 2 adet textbox nesnesi ekleyip textboxlardan birinin textmode

ozelligini password olarak degistiriyoruz

 

-----------------------------------------------------------------

webform1.aspx

-----------------------------------------------------------------

procedure TWebForm1.OnInit(e: EventArgs);

begin

  //

  // Required for Designer support

  //

  InitializeComponent;

  inherited OnInit(e);

  session['izin']:='yok';

end;

 

procedure TWebForm1.Button1_Click(sender: System.Object; e: System.EventArgs);

begin

  if (textbox1.Text='aknet') and (textbox2.Text='1234') then

        begin

        session['izin']:='var';

        response.Redirect('webform2.aspx')

          end else

            response.Write('Kullanıcı adı yada şifre hatalı');

end;

 

-----------------------------------------------------------------

webform2.aspx

-----------------------------------------------------------------

procedure TWebForm2.OnInit(e: EventArgs);

begin

  //

  // Required for Designer support

  //

  InitializeComponent;

  inherited OnInit(e);

  try

  if session['izin'].tostring='var' then response.Write('OK') else Response.Redirect('webform1.aspx');

  except

     response.Redirect('webform1.aspx');

  end;

end;

 

Delphi.NET - .....................................

 

TComboBox Nesnesi ile Secilen Değerinin Kodunu Bulma...

{ Saygı Değer Üyeler, Şu Güzelim Internet Dunyasından Doyasıya Faydalanalım.

   Ben Bu Sitedeki Orneklerden Oldukca Faydalandim. Sonuc Olarak Ornek Tam Calissin Yada Calismasin Onemli Değil Önemli Olan aradığını Bulmak.

Şimdi Bir Örnek te Ben Yayınlamak İstiyorum...

Hepiniz Saygılar...

}

 

{*

 Delphi 7 De Test Edildi, XP TR Service Pack2

 Nasıl Yaparım,

 1 - Tum Projelerinizi Kapatınız

 2 - Component Menusunden New Component Seçiniz

 3 - Ancestor type : Değerini = TComboBox  [StdCtrls] Olarak Seciniz

 4 - Class Name   : THCComboBox

 5 - Palette Pages : Siz Secin

 6 - Unit File Olduğu Yeri Belirtin

 7 - Search Path' e Dokunmayin

 

Yada

  1 - Birinci maddeyi Uygula  (Yukarıda)

  2 - Unit File Name : Aşağıdaki Örneği Kopyaladığınız Unit Pathi Verin

  3 - OK Tıklayın..

 Sonra Kullanınız...

 

 Yeni Özellikler;

   FieldName

   Item_Ekle

   Temizle

   TextKod

*}

unit HCComboBox;

// Hüseyin ÖZÇAKIR - 2006 12 Nisan

interface

 

uses

  SysUtils, Classes, Controls, StdCtrls;

 

type

  RComboYapi = Record

      Kod    : String;

      Deger  : String;

  End;

 

  THCComboBox = class(TComboBox)

  private

    { Private declarations }

    FListe     : Array Of RComboYapi;

    FLisCount  : Integer  ;

 

 

  protected

    { Protected declarations }

    FFieldName : String;

    Function FKodOku: String;

 

  public

    { Public declarations }

 

    Procedure Item_Ekle(Veri : RComboYapi);

    Procedure Temizle;

 

 

  published

    { Published declarations }

    Property FieldName : String Read FFieldName Write FFieldName;

    Property TextKod   : String Read FKodOku;

 

 

 

  end;

 

procedure Register;

 

implementation

 

procedure Register;

begin

  RegisterComponents('OZCAKIRH', [THCComboBox]);

end;

 

function THCComboBox.FKodOku: String;

Var

 i : Integer;

 S : String;

begin

  IF ItemIndex < -1 Then  Result := ''

  Else

   Begin

    S := Text;

     For i:= 1 To FLisCount Do

       IF FListe[i].Deger = S Then

         Begin

         Result := FListe[i].Kod;

         Break;

         End;

   End; // Else

end;

 

Procedure THCComboBox.Temizle;

Begin

 items.Clear;

 FLisCount := 0;

End;

 

Procedure  THCComboBox.Item_Ekle(Veri : RComboYapi);

Begin

 FLisCount := ItemCount;

 SetLength(FListe, FLisCount + 1);

 FListe[FLisCount].Kod := Veri.Kod;

 FListe[FLisCount].Deger := Veri.Deger;

 Items.Add(Veri.Deger );

End;

 

end.

 

Delphi - .....................................

 

TComboBox Nesnesi ile Secilen Değerinin Kodunu Bulma...

{ Saygı Değer Üyeler, Şu Güzelim Internet Dunyasından Doyasıya Faydalanalım.

   Ben Bu Sitedeki Orneklerden Oldukca Faydalandim. Sonuc Olarak Ornek Tam Calissin Yada Calismasin Onemli Değil Önemli Olan aradığını Bulmak.

Şimdi Bir Örnek te Ben Yayınlamak İstiyorum...

Hepiniz Saygılar...

}

 

{*

 Delphi 7 De Test Edildi, XP TR Service Pack2

 Nasıl Yaparım,

 1 - Tum Projelerinizi Kapatınız

 2 - Component Menusunden New Component Seçiniz

 3 - Ancestor type : Değerini = TComboBox  [StdCtrls] Olarak Seciniz

 4 - Class Name   : THCComboBox

 5 - Palette Pages : Siz Secin

 6 - Unit File Olduğu Yeri Belirtin

 7 - Search Path' e Dokunmayin

 

Yada

  1 - Birinci maddeyi Uygula  (Yukarıda)

  2 - Unit File Name : Aşağıdaki Örneği Kopyaladığınız Unit Pathi Verin

  3 - OK Tıklayın..

 Sonra Kullanınız...

 

 Yeni Özellikler;

   FieldName

   Item_Ekle

   Temizle

   TextKod

*}

unit HCComboBox;

// Hüseyin ÖZÇAKIR - 2006 12 Nisan

interface

 

uses

  SysUtils, Classes, Controls, StdCtrls;

 

type

  RComboYapi = Record

      Kod    : String;

      Deger  : String;

  End;

 

  THCComboBox = class(TComboBox)

  private

    { Private declarations }

    FListe     : Array Of RComboYapi;

    FLisCount  : Integer  ;

 

 

  protected

    { Protected declarations }

    FFieldName : String;

    Function FKodOku: String;

 

  public

    { Public declarations }

 

    Procedure Item_Ekle(Veri : RComboYapi);

    Procedure Temizle;

 

 

  published

    { Published declarations }

    Property FieldName : String Read FFieldName Write FFieldName;

    Property TextKod   : String Read FKodOku;

 

 

 

  end;

 

procedure Register;

 

implementation

 

procedure Register;

begin

  RegisterComponents('OZCAKIRH', [THCComboBox]);

end;

 

function THCComboBox.FKodOku: String;

Var

 i : Integer;

 S : String;

begin

  IF ItemIndex < -1 Then  Result := ''

  Else

   Begin

    S := Text;

     For i:= 1 To FLisCount Do

       IF FListe[i].Deger = S Then

         Begin

         Result := FListe[i].Kod;

         Break;

         End;

   End; // Else

end;

 

Procedure THCComboBox.Temizle;

Begin

 items.Clear;

 FLisCount := 0;

End;

 

Procedure  THCComboBox.Item_Ekle(Veri : RComboYapi);

Begin

 FLisCount := ItemCount;

 SetLength(FListe, FLisCount + 1);

 FListe[FLisCount].Kod := Veri.Kod;

 FListe[FLisCount].Deger := Veri.Deger;

 Items.Add(Veri.Deger );

End;

 

end.

 

Delphi - .....................................

 

Delphi.Net de Registry islemleri

Uses satirina Micrfosoft.Win32 ekleyin.

 

procedure TWinForm.Sil_Click(sender: System.Object; e: System.EventArgs);

begin

  Registry.CurrentUser.DeleteValue('deger');

end;

 

procedure TWinForm.Oku_Click(sender: System.Object; e: System.EventArgs);

begin

 label1.Text:=Registry.CurrentUser.GetValue('deger').ToString;

end;

 

procedure TWinForm.Yaz_Click(sender: System.Object; e: System.EventArgs);

begin

  Registry.CurrentUser.SetValue('deger','deneme');

end;

 

Delphi.NET - .....................................

 

SedoRKinG => Programım Windows Açılışında Çalışsın (İsteğe Bağlı)

Evet Bi Kaç Tane Kod Var Ama Bunda İsteğe Bağlı Olarak Program İçinde

Açılışta Başlamasını Açabilir Veya Kapatabilirsiniz.

Gerçi Bunuda Dosya Yazma Örnek Kodu Ve Bi Tanede Açılışta Çalışma Kodunu Alıp Birleştirip Modifiye Ederek Ortaya Çıkardım.

Not:Uses Kısmına Registry Eklemeyi Unutmayın!...

//////////////////////////////////////////////////////////////////////

Kodlar

//////////////////////////////////////////////////////////////////////

procedure TForm1.FormCreate(Sender: TObject);

var

f:file;

begin

if  not fileexists('c:start.dll') then

begin

assignfile(f,'c:start.dll');

rewrite(f);

closefile(f);

end;

if  not fileexists('c:start.dll') then

begin

assignfile(f,'c:start.dll');

rewrite(f);

closefile(f);

end;

Memo1.Lines.loadfromFile('c:start.dll');

if Memo1.Lines.Text='Start' then

CheckBox1.Checked:=True;

end;

 

procedure TForm1.CheckBox1Click(Sender: TObject);

var

f:file;

AppExe :string;

begin

if CheckBox1.Checked=True then

Memo1.Lines.Text:='Start';

with TRegistry.Create do

try

RootKey := HKEY_CURRENT_USER;

if OpenKey ('SOFTWAREMicrosoftWindowsCurrentVersionRun', true) then

AppExe:=#34+Application.Exename+#34;

WriteString('metin', AppExe);

finally

begin

if CheckBox1.Checked=False then

begin

DeleteValue('metin');

Memo1.Lines.Text:='NoStart';

end;

Memo1.Lines.SaveToFile('c:start.dll');

end;

end;

end;

 

Delphi - .....................................

 

SedoRKinG => Programım Windows Açılışında Çalışsın (İsteğe Bağlı)

Evet Bi Kaç Tane Kod Var Ama Bunda İsteğe Bağlı Olarak Program İçinde

Açılışta Başlamasını Açabilir Veya Kapatabilirsiniz.

Gerçi Bunuda Dosya Yazma Örnek Kodu Ve Bi Tanede Açılışta Çalışma Kodunu Alıp Birleştirip Modifiye Ederek Ortaya Çıkardım.

Not:Uses Kısmına Registry Eklemeyi Unutmayın!...

//////////////////////////////////////////////////////////////////////

Kodlar

//////////////////////////////////////////////////////////////////////

procedure TForm1.FormCreate(Sender: TObject);

var

f:file;

begin

if  not fileexists('c:start.dll') then

begin

assignfile(f,'c:start.dll');

rewrite(f);

closefile(f);

end;

if  not fileexists('c:start.dll') then

begin

assignfile(f,'c:start.dll');

rewrite(f);

closefile(f);

end;

Memo1.Lines.loadfromFile('c:start.dll');

if Memo1.Lines.Text='Start' then

CheckBox1.Checked:=True;

end;

 

procedure TForm1.CheckBox1Click(Sender: TObject);

var

f:file;

AppExe :string;

begin

if CheckBox1.Checked=True then

Memo1.Lines.Text:='Start';

with TRegistry.Create do

try

RootKey := HKEY_CURRENT_USER;

if OpenKey ('SOFTWAREMicrosoftWindowsCurrentVersionRun', true) then

AppExe:=#34+Application.Exename+#34;

WriteString('metin', AppExe);

finally

begin

if CheckBox1.Checked=False then

begin

DeleteValue('metin');

Memo1.Lines.Text:='NoStart';

end;

Memo1.Lines.SaveToFile('c:start.dll');

end;

end;

end;

 

Delphi - .....................................

 

Windows ve VCL Form

Asadida basit bir programin Windows form ve VCL form olarak yazilisini bulabilirsiniz. VCL form uygulamalari normal delphi komutlari kullanilarak yazilabiliyor

ancak bu uygulamalarda kullanilan kutuphanelere bagli olarak derlenen uygulama ile birlikte gerekli dll dosyalarininda program ile birlikte tasinmasi gerekiyor. Windows form uygulamalari .net framework ile birlikte calistigindan eksra bir borland kutuphanesine ihyiyac duymuyor. Ornegin windows form uygulamasinda

inttostr komutu yerine convert.tostring kullaniliyor. Siz yinede inttostr kullanmak isterseniz uses satirina "borland.vcl.sysutils" eklemek ve gerekli kutuphaneyi programiniz ile birlikte tasimak

zorundasiniz. Burada yaptigim uygulamayi monoppix 1.1.8 ustunde (Mono ekli live linux versionu) test ettigimde sorunsuz calisti.

 

-----------------------------------------------

VCL FORM

-----------------------------------------------

unit Unit1;

 

interface

 

uses

  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

  Dialogs, Borland.Vcl.StdCtrls, System.ComponentModel;

 

type

  TForm1 = class(TForm)

    Button1: TButton;

    Edit1: TEdit;

    Edit2: TEdit;

    Label1: TLabel;

    Button2: TButton;

    procedure Button2Click(Sender: TObject);

    procedure Button1Click(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

 

implementation

 

{$R *.nfm}

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  label1.Caption:=inttostr(strtoint(edit1.Text)+strtoint(edit2.Text));

end;

 

procedure TForm1.Button2Click(Sender: TObject);

begin

form1.Close;

end;

 

end.

 

-----------------------------------------------

WINDOWS FORM

-----------------------------------------------

unit WinForm;

 

interface

 

uses

  System.Drawing, System.Collections, System.ComponentModel,

  System.Windows.Forms, System.Data;

 

type

  TWinForm = class(System.Windows.Forms.Form)

  {$REGION 'Designer Managed Code'}

  strict private

    /// <summary>

    /// Required designer variable.

    /// </summary>

    Components: System.ComponentModel.Container;

    Button1: System.Windows.Forms.Button;

    Label1: System.Windows.Forms.Label;

    TextBox1: System.Windows.Forms.TextBox;

    TextBox2: System.Windows.Forms.TextBox;

    Button2: System.Windows.Forms.Button;

    /// <summary>

    /// Required method for Designer support - do not modify

    /// the contents of this method with the code editor.

    /// </summary>

    procedure InitializeComponent;

    procedure Button1_Click(sender: System.Object; e: System.EventArgs);

    procedure Button2_Click(sender: System.Object; e: System.EventArgs);

  {$ENDREGION}

  strict protected

    /// <summary>

    /// Clean up any resources being used.

    /// </summary>

    procedure Dispose(Disposing: Boolean); override;

  private

    { Private Declarations }

  public

    constructor Create;

  end;

 

  [assembly: RuntimeRequiredAttribute(TypeOf(TWinForm))]

 

implementation

 

{$AUTOBOX ON}

 

{$REGION 'Windows Form Designer generated code'}

/// <summary>

/// Required method for Designer support -- do not modify

/// the contents of this method with the code editor.

/// </summary>

procedure TWinForm.InitializeComponent;

begin

  Self.Button1 := System.Windows.Forms.Button.Create;

  Self.Label1 := System.Windows.Forms.Label.Create;

  Self.TextBox1 := System.Windows.Forms.TextBox.Create;

  Self.TextBox2 := System.Windows.Forms.TextBox.Create;

  Self.Button2 := System.Windows.Forms.Button.Create;

  Self.SuspendLayout;

  //

  // Button1

  //

  Self.Button1.Location := System.Drawing.Point.Create(56, 96);

  Self.Button1.Name := 'Button1';

  Self.Button1.TabIndex := 0;

  Self.Button1.Text := 'Hesapla';

  Include(Self.Button1.Click, Self.Button1_Click);

  //

  // Label1

  //

  Self.Label1.Location := System.Drawing.Point.Create(168, 48);

  Self.Label1.Name := 'Label1';

  Self.Label1.Size := System.Drawing.Size.Create(96, 16);

  Self.Label1.TabIndex := 1;

  Self.Label1.Text := 'Label1';

  //

  // TextBox1

  //

  Self.TextBox1.Location := System.Drawing.Point.Create(56, 24);

  Self.TextBox1.Name := 'TextBox1';

  Self.TextBox1.TabIndex := 2;

  Self.TextBox1.Text := 'TextBox1';

  //

  // TextBox2

  //

  Self.TextBox2.Location := System.Drawing.Point.Create(56, 56);

  Self.TextBox2.Name := 'TextBox2';

  Self.TextBox2.TabIndex := 3;

  Self.TextBox2.Text := 'TextBox2';

  //

  // Button2

  //

  Self.Button2.Location := System.Drawing.Point.Create(152, 96);

  Self.Button2.Name := 'Button2';

  Self.Button2.TabIndex := 4;

  Self.Button2.Text := 'Kapat';

  Include(Self.Button2.Click, Self.Button2_Click);

  //

  // TWinForm

  //

  Self.AutoScaleBaseSize := System.Drawing.Size.Create(5, 13);

  Self.ClientSize := System.Drawing.Size.Create(292, 266);

  Self.Controls.Add(Self.Button2);

  Self.Controls.Add(Self.TextBox2);

  Self.Controls.Add(Self.TextBox1);

  Self.Controls.Add(Self.Label1);

  Self.Controls.Add(Self.Button1);

  Self.Name := 'TWinForm';

  Self.Text := 'WinForm';

  Self.ResumeLayout(False);

end;

{$ENDREGION}

 

procedure TWinForm.Dispose(Disposing: Boolean);

begin

  if Disposing then

  begin

    if Components <> nil then

      Components.Dispose();

  end;

  inherited Dispose(Disposing);

end;

 

constructor TWinForm.Create;

begin

  inherited Create;

  //

  // Required for Windows Form Designer support

  //

  InitializeComponent;

  //

  // TODO: Add any constructor code after InitializeComponent call

  //

end;

 

procedure TWinForm.Button2_Click(sender: System.Object; e: System.EventArgs);

begin

  Close;

end;

 

procedure TWinForm.Button1_Click(sender: System.Object; e: System.EventArgs);

 

begin

  label1.Text:=convert.ToString(convert.ToInt32(textbox1.text)+convert.toint32(textbox2.Text));

end;

 

end.

 

Delphi.NET - .....................................

 

Windows Dizinlerini Bulma

//Windowsun Kişisel Dizinlerini Bulmaya Yarayan Kodlar...

 

uses ShlObj, ActiveX;

 

function DizinAl(Klasor: Integer): string;

var

  PIDL: PItemIDList;

  Yol: LPSTR;

  AMalloc: IMalloc;

begin

  Yol := StrAlloc(MAX_PATH);

  SHGetSpecialFolderLocation(Application.Handle, Klasor, PIDL);

  if SHGetPathFromIDList(PIDL, Yol) then

    Result := Yol;

  SHGetMalloc(AMalloc);

  AMalloc.Free(PIDL);

  StrDispose(Yol);

end;

 

// Klasör Değişkenin Yerine Yazılacaklar...

 

//CSIDL_DESKTOP Masaüstü Dizini

//CSIDL_DESKTOPDIRECTORY Masaüstü Dizini

//CSIDL_FONTS Fontlar Dizini

//CSIDL_NETHOOD Nethood Klasörü

//CSIDL_PERSONAL Belgelerim Klasörü

//CSIDL_PROGRAMS Başlat Menüsü Programlar Dizini

//CSIDL_RECENT Geçmişte Açılanlar Klasörü

//CSIDL_SENDTO Gönder Klasörü

//CSIDL_STARTMENU Başlat Dizini

//CSIDL_STARTUP Başlangıç Dizini

//CSIDL_TEMPLATES Yeni Oluştur Dizini

 

 

//Kullanımı:

 

//Forma Label Koyun ve Onclick Olayına Yazın

 

procedure TForm1.Label1Click(Sender: TObject);

begin

label1.Caption:=DizinAl(CSIDL_TEMPLATES)

end;

 

//Not Kodlar Yabancı Siteden Alıntıdır...

//Fikri007@hotmail.com

 

Delphi - .....................................

 

Bu web sitesi ücretsiz olarak Bedava-Sitem.com ile oluşturulmuştur. Siz de kendi web sitenizi kurmak ister misiniz?
Ücretsiz kaydol