Programlama yapalım ve Öğrenelim. - Delphi Eğitim124
  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

Bir web adresini açma

 

uses kısmına Shellapi unitini ekleyin;

 

ShellExecute(Handle,

 

            'open',

 

            'http://emreoz.cjb.net',

 

             nil,

 

             nil,

 

             sw_ShowMaximized);

 

 

 

Bir DOS programını çalıştırma ve çalışması bitince penceresini kapatma

 

WinExec("command.com /c progdos.exe",sw_ShowNormal); //progdos.exe çalıştırılıyor.

 

//eğer ikinci paremetreyi sw_Hide yaparsanız kullanıcı programın çalıştığını görmez.

 

 

 

Uygulamanızın Görev Çubuğundaki butonunu gizleme

 

Uygulamanızın Görev Çubuğundaki butonunu gizlemek için programınızın ana formunun OnCreate olayına aşağıdaki kodu yazın;

 

SetWindowLong(Application.Handle,GWL_EXSTYLE, WS_EX_TOOLWINDOW);

 

 

 

Ekran koruyucusunu kapatmak ve açmak

 

//kapatmak için

 

SystemParametersInfo(SPI_SETSCREENSAVEACTIVE,

 

                     0,

 

                     nil,

 

                     0);

 

//açmak için

 

SystemParametersInfo(SPI_SETSCREENSAVEACTIVE,

 

                     1,

 

                     nil,

 

                     0);

 

 

 

Alt+F4 tuş kombinasyonuyla programın kapanmaması için

 

Formun OnCreate olayına;

 

KeyPreview := true;

 

Formun OnKeyDown olayına;

 

if ((ssAlt in Shift) and (Key = VK_F4)) then

 

     Key := 0;

 

 

 

Hareketli İmleç(animated cursor)leri kullanma

 

procedure TForm1.Button1Click(Sender:TObject);

 

var

 

  h : THandle;

 

begin

 

  h := LoadImage(0,

 

                 'C:TheWallMagic.ani',

 

                 IMAGE_CURSOR,

 

                 0,

 

                 0,

 

                 LR_DEFAULTSIZE or

 

                 LR_LOADFROMFILE);

 

  if h = 0 then ShowMessage('Cursor not loaded') else begin

 

    Screen.Cursors[1] := h;

 

    Form1.Cursor := 1;

 

  end;

 

end;

 

 

 

Windows lisans bilgilerinin (isim ve şirket) bulunması

 

uses kısmına Registry unitini ekleyin;

 

procedure TForm1.Button1Click(Sender:TObject);

 

var

 

  reg: TRegIniFile;

 

begin

 

  reg := TRegIniFile.create('SOFTWAREMICROSOFTMS SETUP (ACME)');

 

  Memo1.Lines.Add(reg.ReadString('USER INFO',

 

                                 'DefName',

 

                                 'Emre ÖZ'));

 

  Memo1.Lines.Add(reg.ReadString('USER INFO',

 

                                 'DefCompany',

 

                                 'Bilgisayar Bilimleri Müh.'));

 

  reg.free;

 

end;

 

 

 

Çok Satırlı İpucu

 

procedure TForm1.FormCreate(Sender: TObject);

 

begin

 

  SpeedButton1.Hint:='Çok satırlı ipucunu '+chr(13)+

 

                     'mutlaka denemelisiniz '+chr(13)+

 

                     'çok güzel';

 

end;

 

 

 

Bir klasörü ve onun altındaki tüm dosyaları ve klasörleri silme

 

Ancak salt okunur (read only) özelliği olan ve kullanımda olan dosyalar silinmez.

 

procedure TForm1.Button1Click(Sender: TObject);

 

var

 

  DirInfo: TSearchRec;

 

  r : Integer;

 

begin

 

  r := FindFirst('C:DownloadTest*.*', FaAnyfile, DirInfo);

 

  while r = 0 do  begin

 

    if ((DirInfo.Attr and FaDirectory <> FaDirectory) and

 

        (DirInfo.Attr and FaVolumeId <> FaVolumeID)) then

 

      if DeleteFile(pChar('C:Downloadtest' + DirInfo.Name))

 

         = false then

 

       ShowMessage('C:Downloadtest'+DirInfo.Name+' silinemiyor!!!');

 

    r := FindNext(DirInfo);

 

  end;

 

  SysUtils.FindClose(DirInfo);

 

  if RemoveDirectory('C:DownloadTest') = false then

 

    ShowMessage('C:Downloadtest klasörü silinemiyor!!!');

 

end;

 

 

 

Başlat butonunu gizlemek veya kullanılmaz hale getirmek

 

procedure TForm1.Button1Click(Sender: TObject);

 

var

 

  Rgn : hRgn;

 

begin

 

  // Başlat butonunu gizle

 

  Rgn := CreateRectRgn(0, 0, 0, 0);

 

  SetWindowRgn(FindWindowEx(FindWindow('Shell_TrayWnd', nil),

 

                                       0,

 

                                      'Button',

 

                                       nil),

 

                                       Rgn,

 

                                       true);

 

end;

 

 

 

procedure TForm1.Button2Click(Sender: TObject);

 

begin

 

  //Gizlenen Başlat butonunu eski haline döndürmek için

 

  SetWindowRgn(FindWindowEx(FindWindow('Shell_TrayWnd', nil),

 

                                       0,

 

                                      'Button',

 

                                       nil),

 

                                       0,

 

                                       true);

 

end;

 

 

 

procedure TForm1.Button3Click(Sender: TObject);

 

begin

 

  //Başlat butonunu kullanılmaz yap

 

  EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil),

 

                                       0,

 

                                       'Button',

 

                                       nil),

 

                                       false);

 

end;

 

 

 

procedure TForm1.Button4Click(Sender: TObject);

 

begin

 

  //Kullanılmaz yapılan Başlat butonunu eski haline getirmek için

 

  EnableWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil),

 

                                       0,

 

                                       'Button',

 

                                       nil),

 

                                       true);

 

end;

 

 

 

Windows Gezginini istediğiniz bir klasörle açma

 

uses kısmına Shellapi unitini ekleyin.

 

 

 

ShellExecute(0,

 

            'explore',

 

            'C:WINDOWS',  //açmak istediğiniz dizin

 

             nil,

 

             nil,

 

             SW_SHOWNORMAL);

 

 

 

Duvar kağıdını değiştirmek

 

var

 

  s: string;

 

begin

 

  s := 'c:windowsathena.bmp';

 

  SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, PChar(s),0);

 

 

 

Form'un arka kısmına bir resmi döşemek

 

Bitmap: TBitmap;

 

 

 

procedure TForm1.FormCreate(Sender: TObject);

 

begin

 

  Bitmap := TBitmap.Create;

 

  Bitmap.LoadFromFile('C:WINDOWScars.BMP');

 

end;

 

 

 

procedure TForm1.FormPaint(Sender: TObject);

 

var

 

  X, Y, W, H: LongInt;

 

begin

 

  with Bitmap do begin

 

    W := Width;

 

    H := Height;

 

  end;

 

  Y := 0;

 

  while Y < Height do begin

 

    X := 0;

 

    while X < Width do begin

 

      Canvas.Draw(X, Y, Bitmap);

 

      Inc(X, W);

 

    end;

 

    Inc(Y, H);

 

  end;

 

end;

 

 

 

Bir Denetim Masası uygulamasını çalıştırmak

 

Control Panel uygulamaları WindowsSystem klasörü altında bulunur. *.CPL uzantılı dosyalardır. Bu uygulamaları Control.Exe programı ile çalıştırabilirsiniz. Bazı Control Panel uygulamaları WindowsSystem klasöründe bulunmaz. Bunların ismini vererek çalıştırabilirsiniz.

 

 

 

WinExec('C:WINDOWSCONTROL.EXE TIMEDATE.CPL', sw_ShowNormal);

 

WinExec('C:WINDOWSCONTROL.EXE MOUSE', sw_ShowNormal);

 

WinExec('C:WINDOWSCONTROL.EXE PRINTERS', sw_ShowNormal);

 

 

 

 Sayıları virgüllerle yazmak

 

Sayı windows'unuz ayarına göre 12.345.678 veya 12,345,678 şeklinde gösterilir.

 

procedure TForm1.Button1Click(Sender: TObject);

 

  var

 

    i : integer;

 

begin

 

  i := 12345678;

 

  Memo1.Lines.Add(FormatFloat('#,', i));

 

 

 

Sistem Tarihini ve Saatini Değiştirmek

Sistemin tarihini ve saatini değiştirmek için SetLocalTime fonksiyonunu kullanabilirsiniz.

 

var

 

  t:TSystemTime;

 

begin

 

  t.wYear:=1998;

 

  t.wMonth:=5;

 

  t.wDay:=23;

 

  t.wHour:=12;

 

  t.wMinute:=34;

 

  SetLocalTime(t);

 

end;

 

 

 

Fareyi meşgul şekilde göstermek

try

 

  Screen.Cursor := crHourGlass;

 

  {buraya kodunuzu yazın...}

 

finally

 

  Screen.Cursor := crDefault;

 

end;

 

Application.ProcessMessages;

 

 

 

Dos programı kullanmak için;

WinExec('command.com /c progdos.exe',sw_ShowNormal);

 

 

 

 

 

Çevirme

Edit1.OnChange := NIL;

if Edit1.Text = 'Emre ÖZ' then

Edit1.Text := 'Emre';

Edit1.OnChange := Edit1Change;

 

 

 

 

 

İlk harf büyük diğerleri küçük

Edit1'e yazılan yazının ilk harfini büyük diğer harflerini küçük yapıyor.

 

var

OldStart : Integer;

begin

With Edit1 do

if Text <> '' then begin

OnChange := NIL;

OldStart := SelStart;

Text := UpperCase(Copy(Text,1,1))+LowerCase(Copy(Text,2,Length(Text)));

SelStart := OldStart;

OnChange := Edit1Change;

end;

end;

 

 

 

 

 

Taskbar gizleme

procedure hideTaskbar;

var

wndHandle : THandle;

wndClass : array[0..50] of Char;

begin

StrPCopy(@wndClass[0], 'Shell_TrayWnd');

wndHandle := FindWindow(@wndClass[0], nil);

ShowWindow(wndHandle, SW_HIDE);

end;

 

procedure showTaskbar;

var

wndHandle : THandle;

wndClass : array[0..50] of Char;

begin

StrPCopy(@wndClass[0], 'Shell_TrayWnd');

wndHandle := FindWindow(@wndClass[0], nil);

ShowWindow(wndHandle, SW_RESTORE);

end;

 

 

 

 

 

Ses kaydetme

Bu program mikrofondan sesi alıp bir wav dosyası içine kayıt ediyor.

 

 

uses

MMSystem,

WinCrt;

function RecordSound(MMSecs: LongInt): LongInt;

var

DeviceID: Word;

Return: LongInt;

MciOpen: TMCI_Open_Parms;

MciRecord: TMCI_Record_Parms;

MciPlay: TMCI_Play_Parms;

MciSave: TMCI_SaveParms;

Result2: LongInt;

Flags: Word;

 

begin

MciOpen.lpstrDeviceType := 'waveaudio';

MciOpen.lpstrElementName := '';

Flags := Mci_Open_Element or Mci_Open_Type;

Result2 := MciSendCommand(0, MCI_OPEN, Flags, LongInt(@MciOpen));

DeviceID := MciOpen.wDeviceId;

 

WriteLn('Kayıt');

MciRecord.dwTo := MMSecs;

Flags := Mci_To or Mci_Wait;

Result2 := MciSendCommand(DeviceID, Mci_Record, Flags, LongInt(@MciRecord));

 

WriteLn('Durdur');

mciPlay.dwFrom := 0;

Flags := Mci_From or Mci_Wait;

MciSendCommand(DeviceId, Mci_Play, Flags, LongInt(@MciPlay));

 

mciSave.lpfileName := 'Ses.Wav';

Flags := MCI_Save_File or Mci_Wait;

Result := MciSendCommand(DeviceID, MCI_Save, Flags, LongInt(@MciSave));

MciSendCommand(DeviceID, Mci_Close, 0, LongInt(nil));

 

end;

 

begin

WriteLn('Başla');

RecordSound(10000);

WriteLn('Bitir');

 

 

 

 

 

DELPHİ NASIL EXE YAPIYOR ?

 

Delphi , delphi ile birlikte gelen dcc.exe ile projeleri derliyor. (Delphi 3'de dcc32.exe)

Örnek olarak

dcc /cw /b uls.dpr

komutlar :

/cw : Windows için,

/cd : Dos için,

/cp: Korumalı mod için.

 

/b: Hepsini tekrar oluştur,

/m: Hepsinin güncel olduğundan emin ol.

 

 

 

 

 

BRC Nedir ?

 

Brc Res dosyalarını derliyor.

Bir res dosyası açın ,(Notepad ile)

İçine Icon ICON "emre.ico" yazın. (emre.ico dosyası aynı klasörde bulunmalı. )

BRC -r EMRE.RES olarak derleyin.

Delphideki projenizin başınada {$ Emre.rc} yazın. Böylece ikon dosyalarını taşımadan kullana bilirsiniz.

Sadece icon değil , ayrıca BITMAP,TEXT de kullana bilirsiniz.

******************************************

 

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

 

Klasör kopyalama

uses

  ShellApi;

 

function CopyDir(const fromDir, toDir: string): Boolean;

var

  fos: TSHFileOpStruct;

begin

  ZeroMemory(@fos, SizeOf(fos));

  with fos do

  begin

    wFunc  := FO_COPY;

    fFlags := FOF_FILESONLY;

    pFrom  := PChar(fromDir + #0);

    pTo    := PChar(toDir)

  end;

  Result := (0 = ShFileOperation(fos));

end;

 

 

function MoveDir(const fromDir, toDir: string): Boolean;

var

  fos: TSHFileOpStruct;

begin

  ZeroMemory(@fos, SizeOf(fos));

  with fos do

  begin

    wFunc  := FO_MOVE;

    fFlags := FOF_FILESONLY;

    pFrom  := PChar(fromDir + #0);

    pTo    := PChar(toDir)

  end;

  Result := (0 = ShFileOperation(fos));

end;

 

function DelDir(dir: string): Boolean;

var

  fos: TSHFileOpStruct;

begin

  ZeroMemory(@fos, SizeOf(fos));

  with fos do

  begin

    wFunc  := FO_DELETE;

    fFlags := FOF_SILENT or FOF_NOCONFIRMATION;

    pFrom  := PChar(dir + #0);

  end;

  Result := (0 = ShFileOperation(fos));

end;

 

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  if CopyDir('d:download', 'e:') = True then

    ShowMessage('Directory copied.');

end;

 

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

 

Klasör kopyalama

uses

  ShellApi;

 

function CopyDir(const fromDir, toDir: string): Boolean;

var

  fos: TSHFileOpStruct;

begin

  ZeroMemory(@fos, SizeOf(fos));

  with fos do

  begin

    wFunc  := FO_COPY;

    fFlags := FOF_FILESONLY;

    pFrom  := PChar(fromDir + #0);

    pTo    := PChar(toDir)

  end;

  Result := (0 = ShFileOperation(fos));

end;

 

 

function MoveDir(const fromDir, toDir: string): Boolean;

var

  fos: TSHFileOpStruct;

begin

  ZeroMemory(@fos, SizeOf(fos));

  with fos do

  begin

    wFunc  := FO_MOVE;

    fFlags := FOF_FILESONLY;

    pFrom  := PChar(fromDir + #0);

    pTo    := PChar(toDir)

  end;

  Result := (0 = ShFileOperation(fos));

end;

 

function DelDir(dir: string): Boolean;

var

  fos: TSHFileOpStruct;

begin

  ZeroMemory(@fos, SizeOf(fos));

  with fos do

  begin

    wFunc  := FO_DELETE;

    fFlags := FOF_SILENT or FOF_NOCONFIRMATION;

    pFrom  := PChar(dir + #0);

  end;

  Result := (0 = ShFileOperation(fos));

end;

 

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  if CopyDir('d:download', 'e:') = True then

    ShowMessage('Directory copied.');

end;

 

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

 

Basit bir şifreleme algoritması

function sifrele1(SifrelenecekKatar: WideString):WideString;

var

SifrelenecekKarakter : Widestring;

sira                 : Integer;

SifreliKatar         : WideString;

begin

sifreliKatar:=";

for sira:=length(SifrelenecekKatar) downto 1 do begin

    SifrelenecekKarakter := UNICODEMidStr(SifrelenecekKatar,sira,1);

    SifreliKatar         := SifreliKatar + SifrelenecekKarakter;

    end;

    Result := sifreliKatar;

end;

 

function desifrele1(deSifrelenecekKatar: WideString):WideString;

var

deSifrelenecekKarakter : Widestring;

sira                   : Integer;

deSifreliKatar         : WideString;

begin

deSifreliKatar:=";

for sira:=length(deSifrelenecekKatar) to 1 do begin

    deSifrelenecekKarakter := UNICODEMidStr(deSifrelenecekKatar,sira,1);

    deSifreliKatar         := deSifreliKatar + deSifrelenecekKarakter;

    end;

    Result := deSifreliKatar;

end;

 

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

 

Basit bir şifreleme algoritması

function sifrele1(SifrelenecekKatar: WideString):WideString;

var

SifrelenecekKarakter : Widestring;

sira                 : Integer;

SifreliKatar         : WideString;

begin

sifreliKatar:=";

for sira:=length(SifrelenecekKatar) downto 1 do begin

    SifrelenecekKarakter := UNICODEMidStr(SifrelenecekKatar,sira,1);

    SifreliKatar         := SifreliKatar + SifrelenecekKarakter;

    end;

    Result := sifreliKatar;

end;

 

function desifrele1(deSifrelenecekKatar: WideString):WideString;

var

deSifrelenecekKarakter : Widestring;

sira                   : Integer;

deSifreliKatar         : WideString;

begin

deSifreliKatar:=";

for sira:=length(deSifrelenecekKatar) to 1 do begin

    deSifrelenecekKarakter := UNICODEMidStr(deSifrelenecekKatar,sira,1);

    deSifreliKatar         := deSifreliKatar + deSifrelenecekKarakter;

    end;

    Result := deSifreliKatar;

end;

 

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

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