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

 

neoturk - ...Threads balloon experiment ?...

What is threads good for? If you wonder, maybe this example will give you a clue. It would have been difficult to accomplish something like this without using threads.

 

The example will create a balloon each time the button is pressed, and it will start to slowly descend towards ground. A random side movement is applied during descending, to give the balloon a "wacky" feeling. Each balloon will have it's own "life", within his thread. For each new balloon-position the program will check that it doesn't collide with others. In that case another position will be calculated until a free spot is found. After a while the balloon will land and the thread will be terminated.

 

All thread-activity that results in changes on the form canvas, must be timed with other window activities in the main thread. The Synchronize command takes care of that part, and we don't need to bother to much about it. All we have to do is make sure that all things that goes to the window is put in separate procedures called by Synchronize. Note: You can't pass any variables to a procedure being called with Synchronize. You have to declare these as private within the thread.

 

The program is using three bitmaps, one for the balloon, one "splash"-picture and one with just the background color.

 

If you are of the destructive type, you can aim at a balloon and shoot it down by pressing the left mouse-key.

 

If you want the project files, press here:

 

 

 

 

{-----------------------------------------------------------------------------

 Unit Name: Unit1

 Author:    Mats Asplund

 Purpose:   Threading example

 History:

-----------------------------------------------------------------------------}

 

unit Unit1;

 

interface

 

uses

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

  Dialogs, StdCtrls, ExtCtrls;

 

type

  TBalloonThread = class(TThread)

  private

    fBalloon, fNothing, fSplash: TBitmap;

    fBalloonNo, fWidth, fHeight, x, y, xold, yold, xtmp, ytmp: Integer;

    fOK, fHit: Boolean;

    procedure Draw;

    procedure DrawSplash;

    procedure EraseOldPos;

    procedure CheckPos;

  protected

    procedure Execute; override;

    constructor Create(BalloonNo, Width, Height: Integer;

      BitmapFile1, BitmapFile2, BitMapFile3: TFileName);

  end;

 

  TForm1 = class(TForm)

    Button1: TButton;

    Shape1: TShape;

    procedure Button1Click(Sender: TObject);

    procedure FormCreate(Sender: TObject);

    procedure FormMouseDown(Sender: TObject; Button: TMouseButton;

      Shift: TShiftState; X, Y: Integer);

  private

    BWidth, BHeight, BalloonNo: Integer;

    BallonPositions: array[0..99] of array[0..1] of Integer;

    Hit: array[0..99] of boolean;

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

 

implementation

 

{$R *.dfm}

 

{ TBallonThread }

 

procedure TForm1.FormCreate(Sender: TObject);

var

  Bitmap: TBitmap;

  n: Integer;

begin

  // Initialize

  BalloonNo:= 0;

  for n:= Low(Hit) to High(Hit) do

  begin

    BallonPositions[n, 0]:= 0;

    BallonPositions[n, 1]:= 0;

    Hit[n]:= false;

  end;

  // Check bitmap width and height.

  // All three bitmaps should be of same size.

  Bitmap:= TBitmap.Create;

  Bitmap.LoadFromFile('balloon.bmp');

  BWidth:= Bitmap.Width;

  BHeight:= Bitmap.Height;

end;

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  // Create one Balloon-instance.

  TBalloonThread.Create(BalloonNo, BWidth, BHeight,

    'balloon.bmp', 'nothing.bmp', 'splash.bmp');

  Inc(BalloonNo);

end;

 

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;

  Shift: TShiftState; X, Y: Integer);

var

  n: integer;

begin

  // Check every balloonposition to see if there's a hit.

  for n:= 0 to BalloonNo -1 do

  begin

    if (abs(BallonPositions[n, 0]- X) < BWidth + 1) and

      (abs(BallonPositions[n, 1]- Y) < BHeight + 1) and

      ((BallonPositions[n, 0]- X) <= 0) and

      ((BallonPositions[n, 1]- Y) <= 0) then

        Hit[n]:= true;

  end;

end;

 

constructor TBalloonThread.Create(BalloonNo, Width, Height: Integer;

  BitmapFile1, BitmapFile2, BitmapFile3: TFileName);

begin

  inherited Create(true);

  fBalloonNo:= BalloonNo;

  fWidth:= Width;

  fHeight:= Height;

  fHit:= false;

  // Create bitmaps needed

  fBalloon:= TBitmap.Create;

  fBalloon.LoadFromFile(BitmapFile1);

  fBalloon.TransParentColor:= fBalloon.Canvas.Pixels[0, 0];

  fBalloon.Transparent:= true;

  fNothing:= TBitmap.Create;

  fNothing.LoadFromFile(BitmapFile2);

  fSplash:= TBitmap.Create;

  fSplash.LoadFromFile(BitmapFile3);

  fSplash.TransParentColor:= fSplash.Canvas.Pixels[0, 0];

  fSplash.Transparent:= true;

 

  FreeOnTerminate:= true;

  Resume;

end;

 

procedure TBalloonThread.Execute;

begin

  fOK:= false;

  // First position on screen

  while not fOK do

  begin

    xtmp:= Random(600) +  50;

    ytmp:= 0;

    Synchronize(CheckPos);

  end;

  x:= xtmp;

  y:= ytmp;

  // Main loop

  while not Terminated do

  begin

    // The balloon has landed. Terminate.

    if y > 313 then

    begin

      y:= 313;

      Terminate;

    end;

    // Erase old position - draw new

    Synchronize(EraseOldPos);

    Synchronize(Draw);

    Sleep(400);

    xold:= x;

    yold:= y;

    fOK:= false;

    while not fOK do

    begin

      // Calculate new position

      if Random(2) = 0 then

        xtmp:= x + Random(3)

      else

        xtmp:= x - Random(3);

      if Random(7) < 6 then

        ytmp:= y + Random(3)

      else

        ytmp:= y - Random(3);

      Synchronize(CheckPos);

      // Balloon is hit. Draw splash, then terminate.

      if fHit then

      begin

        Synchronize(EraseOldPos);

        Synchronize(DrawSplash);

        Sleep(200);

        Synchronize(EraseOldPos);

        Terminate;

      end;

    end;

    x:= xtmp;

    y:= ytmp;

  end;

end;

 

procedure TBalloonThread.CheckPos;

var

  n: Integer;

begin

  // Check that new position(xtmp, ytmp) doesn't interfere with

  // any other balloons position.

  for n:= 0 to Form1.BalloonNo - 1 do

  begin

    if n <> fBalloonNo then

    begin

      if (abs(xtmp - Form1.BallonPositions[n, 0]) < fWidth) and

        (abs(ytmp - Form1.BallonPositions[n, 1]) < fHeight) then

      begin

        fOK:= false;

        Exit;

      end;

    end;

  end;

  // Check if hit

  if Form1.Hit[fBalloonNo] then

    fHit:= true;

  // ...It didn't interfere. Set new position.

  Form1.BallonPositions[fBalloonNo, 0]:= xtmp;

  Form1.BallonPositions[fBalloonNo, 1]:= ytmp;

  fOK:= true;

end;

 

procedure TBalloonThread.Draw;

begin

  // Draw balloon in new position

  Form1.Canvas.Draw(x, y, fBalloon);

end;

 

procedure TBalloonThread.EraseOldPos;

begin

  // Draw "nothing" at previous position

  Form1.Canvas.Draw(xold, yold, fNothing);

end;

 

procedure TBalloonThread.DrawSplash;

begin

  // Draw splashpicture. Set position outside screen.

  Form1.Canvas.Draw(x, y, fSplash);

  Form1.BallonPositions[fBalloonNo, 0]:= -fWidth;

  Form1.BallonPositions[fBalloonNo, 1]:= -fHeight;

end;

 

end.

 

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

 

neoturk - ...Threads balloon experiment ?...

What is threads good for? If you wonder, maybe this example will give you a clue. It would have been difficult to accomplish something like this without using threads.

 

The example will create a balloon each time the button is pressed, and it will start to slowly descend towards ground. A random side movement is applied during descending, to give the balloon a "wacky" feeling. Each balloon will have it's own "life", within his thread. For each new balloon-position the program will check that it doesn't collide with others. In that case another position will be calculated until a free spot is found. After a while the balloon will land and the thread will be terminated.

 

All thread-activity that results in changes on the form canvas, must be timed with other window activities in the main thread. The Synchronize command takes care of that part, and we don't need to bother to much about it. All we have to do is make sure that all things that goes to the window is put in separate procedures called by Synchronize. Note: You can't pass any variables to a procedure being called with Synchronize. You have to declare these as private within the thread.

 

The program is using three bitmaps, one for the balloon, one "splash"-picture and one with just the background color.

 

If you are of the destructive type, you can aim at a balloon and shoot it down by pressing the left mouse-key.

 

If you want the project files, press here:

 

 

 

 

{-----------------------------------------------------------------------------

 Unit Name: Unit1

 Author:    Mats Asplund

 Purpose:   Threading example

 History:

-----------------------------------------------------------------------------}

 

unit Unit1;

 

interface

 

uses

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

  Dialogs, StdCtrls, ExtCtrls;

 

type

  TBalloonThread = class(TThread)

  private

    fBalloon, fNothing, fSplash: TBitmap;

    fBalloonNo, fWidth, fHeight, x, y, xold, yold, xtmp, ytmp: Integer;

    fOK, fHit: Boolean;

    procedure Draw;

    procedure DrawSplash;

    procedure EraseOldPos;

    procedure CheckPos;

  protected

    procedure Execute; override;

    constructor Create(BalloonNo, Width, Height: Integer;

      BitmapFile1, BitmapFile2, BitMapFile3: TFileName);

  end;

 

  TForm1 = class(TForm)

    Button1: TButton;

    Shape1: TShape;

    procedure Button1Click(Sender: TObject);

    procedure FormCreate(Sender: TObject);

    procedure FormMouseDown(Sender: TObject; Button: TMouseButton;

      Shift: TShiftState; X, Y: Integer);

  private

    BWidth, BHeight, BalloonNo: Integer;

    BallonPositions: array[0..99] of array[0..1] of Integer;

    Hit: array[0..99] of boolean;

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

 

implementation

 

{$R *.dfm}

 

{ TBallonThread }

 

procedure TForm1.FormCreate(Sender: TObject);

var

  Bitmap: TBitmap;

  n: Integer;

begin

  // Initialize

  BalloonNo:= 0;

  for n:= Low(Hit) to High(Hit) do

  begin

    BallonPositions[n, 0]:= 0;

    BallonPositions[n, 1]:= 0;

    Hit[n]:= false;

  end;

  // Check bitmap width and height.

  // All three bitmaps should be of same size.

  Bitmap:= TBitmap.Create;

  Bitmap.LoadFromFile('balloon.bmp');

  BWidth:= Bitmap.Width;

  BHeight:= Bitmap.Height;

end;

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  // Create one Balloon-instance.

  TBalloonThread.Create(BalloonNo, BWidth, BHeight,

    'balloon.bmp', 'nothing.bmp', 'splash.bmp');

  Inc(BalloonNo);

end;

 

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;

  Shift: TShiftState; X, Y: Integer);

var

  n: integer;

begin

  // Check every balloonposition to see if there's a hit.

  for n:= 0 to BalloonNo -1 do

  begin

    if (abs(BallonPositions[n, 0]- X) < BWidth + 1) and

      (abs(BallonPositions[n, 1]- Y) < BHeight + 1) and

      ((BallonPositions[n, 0]- X) <= 0) and

      ((BallonPositions[n, 1]- Y) <= 0) then

        Hit[n]:= true;

  end;

end;

 

constructor TBalloonThread.Create(BalloonNo, Width, Height: Integer;

  BitmapFile1, BitmapFile2, BitmapFile3: TFileName);

begin

  inherited Create(true);

  fBalloonNo:= BalloonNo;

  fWidth:= Width;

  fHeight:= Height;

  fHit:= false;

  // Create bitmaps needed

  fBalloon:= TBitmap.Create;

  fBalloon.LoadFromFile(BitmapFile1);

  fBalloon.TransParentColor:= fBalloon.Canvas.Pixels[0, 0];

  fBalloon.Transparent:= true;

  fNothing:= TBitmap.Create;

  fNothing.LoadFromFile(BitmapFile2);

  fSplash:= TBitmap.Create;

  fSplash.LoadFromFile(BitmapFile3);

  fSplash.TransParentColor:= fSplash.Canvas.Pixels[0, 0];

  fSplash.Transparent:= true;

 

  FreeOnTerminate:= true;

  Resume;

end;

 

procedure TBalloonThread.Execute;

begin

  fOK:= false;

  // First position on screen

  while not fOK do

  begin

    xtmp:= Random(600) +  50;

    ytmp:= 0;

    Synchronize(CheckPos);

  end;

  x:= xtmp;

  y:= ytmp;

  // Main loop

  while not Terminated do

  begin

    // The balloon has landed. Terminate.

    if y > 313 then

    begin

      y:= 313;

      Terminate;

    end;

    // Erase old position - draw new

    Synchronize(EraseOldPos);

    Synchronize(Draw);

    Sleep(400);

    xold:= x;

    yold:= y;

    fOK:= false;

    while not fOK do

    begin

      // Calculate new position

      if Random(2) = 0 then

        xtmp:= x + Random(3)

      else

        xtmp:= x - Random(3);

      if Random(7) < 6 then

        ytmp:= y + Random(3)

      else

        ytmp:= y - Random(3);

      Synchronize(CheckPos);

      // Balloon is hit. Draw splash, then terminate.

      if fHit then

      begin

        Synchronize(EraseOldPos);

        Synchronize(DrawSplash);

        Sleep(200);

        Synchronize(EraseOldPos);

        Terminate;

      end;

    end;

    x:= xtmp;

    y:= ytmp;

  end;

end;

 

procedure TBalloonThread.CheckPos;

var

  n: Integer;

begin

  // Check that new position(xtmp, ytmp) doesn't interfere with

  // any other balloons position.

  for n:= 0 to Form1.BalloonNo - 1 do

  begin

    if n <> fBalloonNo then

    begin

      if (abs(xtmp - Form1.BallonPositions[n, 0]) < fWidth) and

        (abs(ytmp - Form1.BallonPositions[n, 1]) < fHeight) then

      begin

        fOK:= false;

        Exit;

      end;

    end;

  end;

  // Check if hit

  if Form1.Hit[fBalloonNo] then

    fHit:= true;

  // ...It didn't interfere. Set new position.

  Form1.BallonPositions[fBalloonNo, 0]:= xtmp;

  Form1.BallonPositions[fBalloonNo, 1]:= ytmp;

  fOK:= true;

end;

 

procedure TBalloonThread.Draw;

begin

  // Draw balloon in new position

  Form1.Canvas.Draw(x, y, fBalloon);

end;

 

procedure TBalloonThread.EraseOldPos;

begin

  // Draw "nothing" at previous position

  Form1.Canvas.Draw(xold, yold, fNothing);

end;

 

procedure TBalloonThread.DrawSplash;

begin

  // Draw splashpicture. Set position outside screen.

  Form1.Canvas.Draw(x, y, fSplash);

  Form1.BallonPositions[fBalloonNo, 0]:= -fWidth;

  Form1.BallonPositions[fBalloonNo, 1]:= -fHeight;

end;

 

end.

 

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

 

neoturk - ...Web hit counter ?...

Every homepage got to have one! Let's make a hitcounter.

This hitcounter produces an image, which is built with seven individual number segments, pasted into a frame image. The maximum count would be 10 million hits, enough for most homepages, mine included !

The number images are 11 x 20 pixels, contained in an ImageList component like this:

 

 

 

 

The frame image is 81 x 24 pixels, and looks like this:

 

We'll use a textfile for storing the hit count. Each time the page is accessed, we increment this value, find the corresponding image from the imagelist for each value position and paste each image into the frame at right positions. When ready, we convert the bitmap image to a jpg, and save it to a TMemorystream, and finally we send the stream as response to the user.

The hitcounter is called from the HTML code just like any other image would be: <img src="/cgi-bin/count.cgi?XXX">

XXX is the name of the hitcount file without extension.

 

If you want the project files, press here:

An admin exe is included.

{-----------------------------------------------------------------------------

 Unit Name: Unit1

 Author:    Mats Asplund

 Purpose:   A web hitcounter

 Usage:     1. Create a textfile and write the startcount on the first row.

               Name it: XXX.cnt

            2. Place frame.bmp in the /cgi-bin library.

            3. Place a link: <img src="/cgi-bin/count.cgi?XXX"> on the webpage.

-----------------------------------------------------------------------------}

 

unit Unit1;

 

interface

 

uses

  SysUtils, Classes, HTTPApp, ImgList, Controls, Graphics, JPeg;

 

type

  TWebModule1 = class(TWebModule)

    ImageList1: TImageList;

    procedure WebModule1WebActionItem1Action(Sender: TObject;

      Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

  end;

 

var

  WebModule1: TWebModule1;

 

implementation

 

{$R *.DFM}

 

procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;

  Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

var

  Jpg: TJpegImage;

  Number, Frame: TBitMap;

  CountStr, CounterName: string;

  HitCount, n: integer;

  Count: TStringList;

  ResponseStream: TMemoryStream;

begin

  ResponseStream:= TMemoryStream.Create;

  Number:= TBitMap.Create;

  Frame:= TBitMap.Create;

  Jpg := TJpegImage.Create;

  Count:= TStringList.Create;

  try

    // Get name of the counter from request and load the corresponding file

    CounterName:= Request.QueryFields[0];

    Count.LoadFromFile(CounterName + '.cnt');

 

    // Increment hitcount and save it back to file

    HitCount:= StrToInt(Count[0]);

    Inc(HitCount);

    Count[0]:= IntToStr(HitCount);

    CountStr:= Count[0];

    Count.SaveToFile(CounterName + '.cnt');

 

    // Add leading zeros to count

    case Length(CountStr) of

      1: CountStr:= '000000' + CountStr;

      2: CountStr:= '00000' + CountStr;

      3: CountStr:= '0000' + CountStr;

      4: CountStr:= '000' + CountStr;

      5: CountStr:= '00' + CountStr;

      6: CountStr:= '0' + CountStr;

    end;

 

    // Get all seven counternumbers from ImageList and paste them into the

    // the frame bitmap at right positions.

    Frame.LoadFromFile('frame.bmp');

    for n:= 1 to 7 do

    begin

      // Number bitmaps are 11 x 20 pix. Frame bitmap is 81 x 24 pix.

      ImageList1.GetBitmap(StrToInt(CountStr[n]), Number);

      Frame.Canvas.Draw(2 + (11 * (n - 1)), 2, Number);

    end;

 

    // Convert the resulting bitmap to jpg and save it to the stream

    Jpg.Assign(Frame);

    Jpg.SaveToStream(ResponseStream);

 

    // Send the stream as response

    ResponseStream.Position:= 0;

    Response.ContentType := 'image/jpeg';

    Response.ContentStream:= ResponseStream;

    Response.SendResponse;

  finally

    Number.Free;

    Frame.Free;

    Count.Free;

  end;

end;

 

end.

 

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

 

neoturk - ...Web hit counter ?...

Every homepage got to have one! Let's make a hitcounter.

This hitcounter produces an image, which is built with seven individual number segments, pasted into a frame image. The maximum count would be 10 million hits, enough for most homepages, mine included !

The number images are 11 x 20 pixels, contained in an ImageList component like this:

 

 

 

 

The frame image is 81 x 24 pixels, and looks like this:

 

We'll use a textfile for storing the hit count. Each time the page is accessed, we increment this value, find the corresponding image from the imagelist for each value position and paste each image into the frame at right positions. When ready, we convert the bitmap image to a jpg, and save it to a TMemorystream, and finally we send the stream as response to the user.

The hitcounter is called from the HTML code just like any other image would be: <img src="/cgi-bin/count.cgi?XXX">

XXX is the name of the hitcount file without extension.

 

If you want the project files, press here:

An admin exe is included.

{-----------------------------------------------------------------------------

 Unit Name: Unit1

 Author:    Mats Asplund

 Purpose:   A web hitcounter

 Usage:     1. Create a textfile and write the startcount on the first row.

               Name it: XXX.cnt

            2. Place frame.bmp in the /cgi-bin library.

            3. Place a link: <img src="/cgi-bin/count.cgi?XXX"> on the webpage.

-----------------------------------------------------------------------------}

 

unit Unit1;

 

interface

 

uses

  SysUtils, Classes, HTTPApp, ImgList, Controls, Graphics, JPeg;

 

type

  TWebModule1 = class(TWebModule)

    ImageList1: TImageList;

    procedure WebModule1WebActionItem1Action(Sender: TObject;

      Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

  end;

 

var

  WebModule1: TWebModule1;

 

implementation

 

{$R *.DFM}

 

procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;

  Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

var

  Jpg: TJpegImage;

  Number, Frame: TBitMap;

  CountStr, CounterName: string;

  HitCount, n: integer;

  Count: TStringList;

  ResponseStream: TMemoryStream;

begin

  ResponseStream:= TMemoryStream.Create;

  Number:= TBitMap.Create;

  Frame:= TBitMap.Create;

  Jpg := TJpegImage.Create;

  Count:= TStringList.Create;

  try

    // Get name of the counter from request and load the corresponding file

    CounterName:= Request.QueryFields[0];

    Count.LoadFromFile(CounterName + '.cnt');

 

    // Increment hitcount and save it back to file

    HitCount:= StrToInt(Count[0]);

    Inc(HitCount);

    Count[0]:= IntToStr(HitCount);

    CountStr:= Count[0];

    Count.SaveToFile(CounterName + '.cnt');

 

    // Add leading zeros to count

    case Length(CountStr) of

      1: CountStr:= '000000' + CountStr;

      2: CountStr:= '00000' + CountStr;

      3: CountStr:= '0000' + CountStr;

      4: CountStr:= '000' + CountStr;

      5: CountStr:= '00' + CountStr;

      6: CountStr:= '0' + CountStr;

    end;

 

    // Get all seven counternumbers from ImageList and paste them into the

    // the frame bitmap at right positions.

    Frame.LoadFromFile('frame.bmp');

    for n:= 1 to 7 do

    begin

      // Number bitmaps are 11 x 20 pix. Frame bitmap is 81 x 24 pix.

      ImageList1.GetBitmap(StrToInt(CountStr[n]), Number);

      Frame.Canvas.Draw(2 + (11 * (n - 1)), 2, Number);

    end;

 

    // Convert the resulting bitmap to jpg and save it to the stream

    Jpg.Assign(Frame);

    Jpg.SaveToStream(ResponseStream);

 

    // Send the stream as response

    ResponseStream.Position:= 0;

    Response.ContentType := 'image/jpeg';

    Response.ContentStream:= ResponseStream;

    Response.SendResponse;

  finally

    Number.Free;

    Frame.Free;

    Count.Free;

  end;

end;

 

end.

 

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

 

neoturk - ...Delphi talks - using speech technology with your delphi apps ?...

There is not very much needed to enable Text to Speech to work in your applications. In this example I'm going to show how we can gain access to Speech Libraries compatible with Microsoft's Speech API (SAPI) using Delphi's ActiveX/COM features, in particular Automation Objects. There's just a few lines of code needed.

 

If you want the project files, press here:

 

 

 

unit Unit1;

 

interface

 

uses

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

  Dialogs, StdCtrls, ComObj;

 

type

  TForm1 = class(TForm)

    Button1: TButton;

    procedure FormCreate(Sender: TObject);

    procedure Button1Click(Sender: TObject);

  private

    VTxt: variant;

    procedure Speak(Text: string);

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

 

const

  vtxtst_SPREADSHEET = $40;

  vtxtsp_VERYHIGH = $80;

 

implementation

{$R *.dfm}

 

procedure TForm1.FormCreate(Sender: TObject);

begin

  VTxt:= CreateOLEObject('Speech.VoiceText');

  try

    VTxt.Register('', Application.ExeName);

  except on EOLEException do

  end;

end;

 

procedure TForm1.Speak(Text: string);

var

  n: integer;

begin

  for n:= 1 to Length(Text) do

    if not (Text[n] in ['a'..'z', 'A'..'Z', '0'..'9', ' ']) then Exit;

  VTxt.Speak(Text, vtxtst_SPREADSHEET or vtxtsp_VERYHIGH);

end;

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  Speak('Using Speech Technology with your Delphi Applications');

end;

 

end.

 

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

 

neoturk - ...Delphi talks - using speech technology with your delphi apps ?...

There is not very much needed to enable Text to Speech to work in your applications. In this example I'm going to show how we can gain access to Speech Libraries compatible with Microsoft's Speech API (SAPI) using Delphi's ActiveX/COM features, in particular Automation Objects. There's just a few lines of code needed.

 

If you want the project files, press here:

 

 

 

unit Unit1;

 

interface

 

uses

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

  Dialogs, StdCtrls, ComObj;

 

type

  TForm1 = class(TForm)

    Button1: TButton;

    procedure FormCreate(Sender: TObject);

    procedure Button1Click(Sender: TObject);

  private

    VTxt: variant;

    procedure Speak(Text: string);

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

 

const

  vtxtst_SPREADSHEET = $40;

  vtxtsp_VERYHIGH = $80;

 

implementation

{$R *.dfm}

 

procedure TForm1.FormCreate(Sender: TObject);

begin

  VTxt:= CreateOLEObject('Speech.VoiceText');

  try

    VTxt.Register('', Application.ExeName);

  except on EOLEException do

  end;

end;

 

procedure TForm1.Speak(Text: string);

var

  n: integer;

begin

  for n:= 1 to Length(Text) do

    if not (Text[n] in ['a'..'z', 'A'..'Z', '0'..'9', ' ']) then Exit;

  VTxt.Speak(Text, vtxtst_SPREADSHEET or vtxtsp_VERYHIGH);

end;

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  Speak('Using Speech Technology with your Delphi Applications');

end;

 

end.

 

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

 

neoturk - ...Telnet firewall tester ?...

We have to live with these things: I'm talking about firewalls.

Deployment of client/server- and multitier systems can be very annoying in company networks, where you don't have control over the firewalls. Lets say you have a DCOM application using two ports 135 and 1234. The server part is to be placed behind a firewall. You order these ports to be opened, install your application and it won't work. Of course, there could be many reasons why it doesn't, but in your lab there was no problem. Is the ports you ordered really open?

This little simple tester could help you. Execute it on the server machine, and use telnet to connect to it from a client machine. If you wan't to change the port on the server, you can do it from the client side. The server echoes back each line you type, except lines beginning with a "P". In that case the server expects a new port number to follow.

In our example, port 135 is already assigned to a RPC-server, (every Windows machine are), and will cause an exception in the server, if set. If this happens the server will "eat" the exception and default back to port 23, where it can be reached again.

If you try: telnet localhost 135 in a command window, you will see an empty window. Thats because something is answering. You can use this technique to determine if a firewall port is open, if you know for certain that there should be a server answering to telnet on that port.

Lets try using the tester for port 1234. First place the tester on the server machine, set the port to 1234 and press activate. Walk over to a client machine and type: telnet <server name or ip> 1234. If the port you ordered is open, you should get a resultat like below, and you have to think about other reasons to why your app isn't working.

 

 

 

 

Download the project:

 

 

 

Here's the code:

 

unit Unit1;

 

interface

 

uses

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

  Dialogs, IdBaseComponent, IdComponent, IdTelnetServer, IdTCPServer, Menus,

  ExtCtrls, StdCtrls, Spin, AppDlg;

 

type

  TForm1 = class(TForm)

    Button1: TButton;

    Label1: TLabel;

    SpinEdit1: TSpinEdit;

    Timer1: TTimer;

    MainMenu1: TMainMenu;

    Help1: TMenuItem;

    Instructions1: TMenuItem;

    AboutTelnetserver1: TMenuItem;

    AppDlg1: TAppDlg;

    procedure Button1Click(Sender: TObject);

    procedure FormCreate(Sender: TObject);

    procedure Timer1Timer(Sender: TObject);

    procedure Instructions1Click(Sender: TObject);

    procedure AboutTelnetserver1Click(Sender: TObject);

  private

    Telnet: TIdTelnetServer;

    Cmd: string;

    procedure CreateServer(Port: integer);

    procedure NewPort;

    procedure IdTelnetServer1Execute(AThread: TIdPeerThread);

    procedure IdTelnetServer1Exception(AThread: TIdPeerThread;

      AException: Exception);

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

 

implementation

 

uses IdTCPConnection, Unit2;

 

{$R *.dfm}

 

procedure TForm1.IdTelnetServer1Execute(AThread: TIdPeerThread);

var

  Port: integer;

begin

  try

    Timer1.Enabled:= false;

    with AThread.Connection do

    begin

      Cmd:= Trim(ReadLn());

      if Cmd <> '' then

        if Cmd[1] = 'P' then

        begin

          try

            Port:= StrToInt(Trim(Copy(Cmd, 2, 100)));

            WriteLn('Changing to port ' + IntToStr(Port));

            WriteLn('Goodbye!');

            Disconnect;

          except

            WriteLn('Port not changed');

            Cmd:= '';

          end;

        end

        else

          if UpperCase(Cmd) = 'EXIT' then

          begin

            WriteLn('Goodbye!');

            Disconnect;

          end

          else

            WriteLn('echo ' + Cmd);

    end;

  finally

    Timer1.Enabled:= true;

  end;

end;

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  try

    if Button1.Caption = 'Activate' then

    begin

      CreateServer(SpinEdit1.Value);

      Button1.Caption:= 'Deactivate';

      Caption:= 'Telnet server, port ' + IntToStr(Telnet.DefaultPort);

      SpinEdit1.Enabled:= false;

    end

    else

    begin

      Telnet.Free;

      Button1.Caption:= 'Activate';

      SpinEdit1.Enabled:= true;

    end

  except

    Cmd:= 'P23';

    NewPort;

  end;

end;

 

procedure TForm1.FormCreate(Sender: TObject);

begin

  CreateServer(23);

end;

 

procedure TForm1.NewPort;

begin

  try

    if Cmd <> '' then

      if Cmd[1] = 'P' then

      begin

        Telnet.Free;

        Sleep(100);

        CreateServer(StrToInt(Trim(Copy(Cmd, 2, 100))));

        Caption:= 'Telnet server, port ' + IntToStr(Telnet.DefaultPort);

        SpinEdit1.Value:= Telnet.DefaultPort;

        Cmd:= '';

      end;

  except

    Cmd:= 'P23';

    NewPort;

  end;

end;

 

procedure TForm1.Timer1Timer(Sender: TObject);

begin

  NewPort;

end;

 

procedure TForm1.CreateServer(Port: integer);

begin

  Telnet:= TIdTelnetServer.Create(nil);

  Telnet.DefaultPort:= Port;

  Telnet.LoginMessage:= 'Connected to Telnet server, port ' +

    IntToStr(Telnet.DefaultPort) + #13#10 + 'Type: P<portnumber><return> to ' +

    'change listening port' + #13#10 + 'EXIT to terminate';

  Telnet.OnExecute:= IdTelnetServer1Execute;

  Telnet.OnException:= IdTelnetServer1Exception;

  Telnet.Active:= true;

end;

 

procedure TForm1.Instructions1Click(Sender: TObject);

begin

  Form2.Show;

end;

 

procedure TForm1.AboutTelnetserver1Click(Sender: TObject);

begin

  AppDlg1.Execute;

end;

 

procedure TForm1.IdTelnetServer1Exception(AThread: TIdPeerThread;

  AException: Exception);

begin

  MessageDlg(AException.Message, mtError, [mbOK], 0);

end;

 

end.

 

 

 

And the Unit1.dfm file:

 

 

 

 

object Form1: TForm1

  Left = 339

  Top = 309

  Width = 269

  Height = 121

  BorderIcons = [biSystemMenu]

  Caption = 'Telnet server, port 23'

  Color = clBtnFace

  Font.Charset = DEFAULT_CHARSET

  Font.Color = clWindowText

  Font.Height = -11

  Font.Name = 'MS Sans Serif'

  Font.Style = []

  Menu = MainMenu1

  OldCreateOrder = False

  OnCreate = FormCreate

  PixelsPerInch = 96

  TextHeight = 13

  object Label1: TLabel

    Left = 24

    Top = 8

    Width = 28

    Height = 13

    Caption = 'Port:'

    Font.Charset = DEFAULT_CHARSET

    Font.Color = clWindowText

    Font.Height = -11

    Font.Name = 'MS Sans Serif'

    Font.Style = [fsBold]

    ParentFont = False

  end

  object Button1: TButton

    Left = 96

    Top = 21

    Width = 75

    Height = 25

    Caption = 'Activate'

    Font.Charset = DEFAULT_CHARSET

    Font.Color = clWindowText

    Font.Height = -11

    Font.Name = 'MS Sans Serif'

    Font.Style = [fsBold]

    ParentFont = False

    TabOrder = 0

    OnClick = Button1Click

  end

  object SpinEdit1: TSpinEdit

    Left = 24

    Top = 24

    Width = 65

    Height = 22

    MaxValue = 0

    MinValue = 0

    TabOrder = 1

    Value = 23

  end

  object Timer1: TTimer

    OnTimer = Timer1Timer

    Left = 224

    Top = 24

  end

  object MainMenu1: TMainMenu

    Left = 184

    Top = 16

    object Help1: TMenuItem

      Caption = 'Help'

      object Instructions1: TMenuItem

        Caption = 'Instructions'

        OnClick = Instructions1Click

      end

      object AboutTelnetserver1: TMenuItem

        Caption = 'About Telnet server'

        OnClick = AboutTelnetserver1Click

      end

    end

  end

  object AppDlg1: TAppDlg

    Left = 120

    Top = 8

  end

end

 

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

 

neoturk - ...Telnet firewall tester ?...

We have to live with these things: I'm talking about firewalls.

Deployment of client/server- and multitier systems can be very annoying in company networks, where you don't have control over the firewalls. Lets say you have a DCOM application using two ports 135 and 1234. The server part is to be placed behind a firewall. You order these ports to be opened, install your application and it won't work. Of course, there could be many reasons why it doesn't, but in your lab there was no problem. Is the ports you ordered really open?

This little simple tester could help you. Execute it on the server machine, and use telnet to connect to it from a client machine. If you wan't to change the port on the server, you can do it from the client side. The server echoes back each line you type, except lines beginning with a "P". In that case the server expects a new port number to follow.

In our example, port 135 is already assigned to a RPC-server, (every Windows machine are), and will cause an exception in the server, if set. If this happens the server will "eat" the exception and default back to port 23, where it can be reached again.

If you try: telnet localhost 135 in a command window, you will see an empty window. Thats because something is answering. You can use this technique to determine if a firewall port is open, if you know for certain that there should be a server answering to telnet on that port.

Lets try using the tester for port 1234. First place the tester on the server machine, set the port to 1234 and press activate. Walk over to a client machine and type: telnet <server name or ip> 1234. If the port you ordered is open, you should get a resultat like below, and you have to think about other reasons to why your app isn't working.

 

 

 

 

Download the project:

 

 

 

Here's the code:

 

unit Unit1;

 

interface

 

uses

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

  Dialogs, IdBaseComponent, IdComponent, IdTelnetServer, IdTCPServer, Menus,

  ExtCtrls, StdCtrls, Spin, AppDlg;

 

type

  TForm1 = class(TForm)

    Button1: TButton;

    Label1: TLabel;

    SpinEdit1: TSpinEdit;

    Timer1: TTimer;

    MainMenu1: TMainMenu;

    Help1: TMenuItem;

    Instructions1: TMenuItem;

    AboutTelnetserver1: TMenuItem;

    AppDlg1: TAppDlg;

    procedure Button1Click(Sender: TObject);

    procedure FormCreate(Sender: TObject);

    procedure Timer1Timer(Sender: TObject);

    procedure Instructions1Click(Sender: TObject);

    procedure AboutTelnetserver1Click(Sender: TObject);

  private

    Telnet: TIdTelnetServer;

    Cmd: string;

    procedure CreateServer(Port: integer);

    procedure NewPort;

    procedure IdTelnetServer1Execute(AThread: TIdPeerThread);

    procedure IdTelnetServer1Exception(AThread: TIdPeerThread;

      AException: Exception);

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

 

implementation

 

uses IdTCPConnection, Unit2;

 

{$R *.dfm}

 

procedure TForm1.IdTelnetServer1Execute(AThread: TIdPeerThread);

var

  Port: integer;

begin

  try

    Timer1.Enabled:= false;

    with AThread.Connection do

    begin

      Cmd:= Trim(ReadLn());

      if Cmd <> '' then

        if Cmd[1] = 'P' then

        begin

          try

            Port:= StrToInt(Trim(Copy(Cmd, 2, 100)));

            WriteLn('Changing to port ' + IntToStr(Port));

            WriteLn('Goodbye!');

            Disconnect;

          except

            WriteLn('Port not changed');

            Cmd:= '';

          end;

        end

        else

          if UpperCase(Cmd) = 'EXIT' then

          begin

            WriteLn('Goodbye!');

            Disconnect;

          end

          else

            WriteLn('echo ' + Cmd);

    end;

  finally

    Timer1.Enabled:= true;

  end;

end;

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  try

    if Button1.Caption = 'Activate' then

    begin

      CreateServer(SpinEdit1.Value);

      Button1.Caption:= 'Deactivate';

      Caption:= 'Telnet server, port ' + IntToStr(Telnet.DefaultPort);

      SpinEdit1.Enabled:= false;

    end

    else

    begin

      Telnet.Free;

      Button1.Caption:= 'Activate';

      SpinEdit1.Enabled:= true;

    end

  except

    Cmd:= 'P23';

    NewPort;

  end;

end;

 

procedure TForm1.FormCreate(Sender: TObject);

begin

  CreateServer(23);

end;

 

procedure TForm1.NewPort;

begin

  try

    if Cmd <> '' then

      if Cmd[1] = 'P' then

      begin

        Telnet.Free;

        Sleep(100);

        CreateServer(StrToInt(Trim(Copy(Cmd, 2, 100))));

        Caption:= 'Telnet server, port ' + IntToStr(Telnet.DefaultPort);

        SpinEdit1.Value:= Telnet.DefaultPort;

        Cmd:= '';

      end;

  except

    Cmd:= 'P23';

    NewPort;

  end;

end;

 

procedure TForm1.Timer1Timer(Sender: TObject);

begin

  NewPort;

end;

 

procedure TForm1.CreateServer(Port: integer);

begin

  Telnet:= TIdTelnetServer.Create(nil);

  Telnet.DefaultPort:= Port;

  Telnet.LoginMessage:= 'Connected to Telnet server, port ' +

    IntToStr(Telnet.DefaultPort) + #13#10 + 'Type: P<portnumber><return> to ' +

    'change listening port' + #13#10 + 'EXIT to terminate';

  Telnet.OnExecute:= IdTelnetServer1Execute;

  Telnet.OnException:= IdTelnetServer1Exception;

  Telnet.Active:= true;

end;

 

procedure TForm1.Instructions1Click(Sender: TObject);

begin

  Form2.Show;

end;

 

procedure TForm1.AboutTelnetserver1Click(Sender: TObject);

begin

  AppDlg1.Execute;

end;

 

procedure TForm1.IdTelnetServer1Exception(AThread: TIdPeerThread;

  AException: Exception);

begin

  MessageDlg(AException.Message, mtError, [mbOK], 0);

end;

 

end.

 

 

 

And the Unit1.dfm file:

 

 

 

 

object Form1: TForm1

  Left = 339

  Top = 309

  Width = 269

  Height = 121

  BorderIcons = [biSystemMenu]

  Caption = 'Telnet server, port 23'

  Color = clBtnFace

  Font.Charset = DEFAULT_CHARSET

  Font.Color = clWindowText

  Font.Height = -11

  Font.Name = 'MS Sans Serif'

  Font.Style = []

  Menu = MainMenu1

  OldCreateOrder = False

  OnCreate = FormCreate

  PixelsPerInch = 96

  TextHeight = 13

  object Label1: TLabel

    Left = 24

    Top = 8

    Width = 28

    Height = 13

    Caption = 'Port:'

    Font.Charset = DEFAULT_CHARSET

    Font.Color = clWindowText

    Font.Height = -11

    Font.Name = 'MS Sans Serif'

    Font.Style = [fsBold]

    ParentFont = False

  end

  object Button1: TButton

    Left = 96

    Top = 21

    Width = 75

    Height = 25

    Caption = 'Activate'

    Font.Charset = DEFAULT_CHARSET

    Font.Color = clWindowText

    Font.Height = -11

    Font.Name = 'MS Sans Serif'

    Font.Style = [fsBold]

    ParentFont = False

    TabOrder = 0

    OnClick = Button1Click

  end

  object SpinEdit1: TSpinEdit

    Left = 24

    Top = 24

    Width = 65

    Height = 22

    MaxValue = 0

    MinValue = 0

    TabOrder = 1

    Value = 23

  end

  object Timer1: TTimer

    OnTimer = Timer1Timer

    Left = 224

    Top = 24

  end

  object MainMenu1: TMainMenu

    Left = 184

    Top = 16

    object Help1: TMenuItem

      Caption = 'Help'

      object Instructions1: TMenuItem

        Caption = 'Instructions'

        OnClick = Instructions1Click

      end

      object AboutTelnetserver1: TMenuItem

        Caption = 'About Telnet server'

        OnClick = AboutTelnetserver1Click

      end

    end

  end

  object AppDlg1: TAppDlg

    Left = 120

    Top = 8

  end

end

 

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

 

neoturk - ...Client-server with web services ?...

Web Service applications are a special form of Web Server application. Support for Web Services is built on top of the Web Broker architecture. To understand the code that the SOAP Application wizard generates, therefore, it is helpful to understand the Web Broker architecture.

You will need D6 or 7 Enterprise and a webserver for this project.

 

The Server

Start with launching the SOAP application wizard, choose File|New|Other, and on the WebServices page, double-click the Soap Server Application icon.

 

 

 

Choose the type of Web server application you want to use for your Web Service. In our case it will be: CGI stand-alone executable.

 

 

 

 

 

In the "Add New WebService" - dialog, write:

 

 

 

The wizard generates a new Web server application that includes a Web module which contains three components:

 

 

 

An invoker component (THTTPSoapPascalInvoker). The invoker converts between SOAP messages and the methods of any registered invokable interfaces in your Web Service application.

A dispatcher component (THTTPSoapDispatcher). The dispatcher automatically responds to incoming SOAP messages and forwards them to the invoker. You can use its WebDispatch property to identify the HTTP request messages to which your application responds. This involves setting the PathInfo property to indicate the path portion of any URL directed to your application, and the MethodType property to indicate the method header for request messages.

A WSDL publisher (TWSDLHTMLPublish). The WSDL publisher publishes a WSDL document that describes your interfaces and how to call them. The WSDL document tells clients how to call on your Web Service application.

The SOAP dispatcher and WSDL publisher are auto-dispatching components. This means they automatically register themselves with the Web module so that it forwards any incoming requests addressed using the path information they specify in their WebDispatch properties. If you right-click on the Web module, you can see that in addition to these auto-dispatching components, it has a single Web action item named DefaultHandler.

 

DefaultHandler is the default action item. That is, if the Web module receives a request for which it can't find a handler (can't match the path information), it forwards that message to the default action item. DefaultHandler generates a Web page that describes your Web Service. To change the default action, edit this action item's OnAction event handler.

 

Let's start some coding. We'll just make a tiny interface to see if things work. By now you should have three units in your project: Unit1, SOAPAdderImpl and SOAPAdderIntf. Place the following code in the implementation unit:

 

{ Invokable implementation File for TSOAPAdder which implements ISOAPAdder }

 

unit SOAPAdderImpl;

 

interface

 

uses InvokeRegistry, Types, XSBuiltIns, SOAPAdderIntf;

 

type

 

  { TSOAPAdder }

  TSOAPAdder = class(TInvokableClass, ISOAPAdder)

  public

    function Add(A, B: integer): integer; stdcall;

  end;

 

implementation

 

{ TSOAPAdder }

 

function TSOAPAdder.Add(A, B: integer): integer;

begin

  Result:= A + B;

end;

 

initialization

  { Invokable classes must be registered }

  InvRegistry.RegisterInvokableClass(TSOAPAdder);

 

end.

 

 

Place the Add-function in the interface unit as well:

 

{ Invokable interface ISOAPAdder }

 

unit SOAPAdderIntf;

 

interface

 

uses InvokeRegistry, Types, XSBuiltIns;

 

type

 

  { Invokable interfaces must derive from IInvokable }

  ISOAPAdder = interface(IInvokable)

  ['{66FAF3AA-0228-47D2-A49A-250D86DE2C98}']

    function Add(A, B: integer): integer; stdcall;

 

    { Methods of Invokable interface must not use the default }

    { calling convention; stdcall is recommended }

  end;

 

implementation

 

initialization

  { Invokable interfaces must be registered }

  InvRegistry.RegisterInterface(TypeInfo(ISOAPAdder));

 

end.

 

 

 

Save your project as: SOAPAdder_cgi.dpr and compile it. You should now have a file called: SOAPAdder_cgi.exe in your project folder. Copy this file to your webserver's library /cgi-bin

 

You should be able to see a description of your interface at: http://<your server>/cgi-bin/SOAPAdder_cgi.exe

 

 

 

This completes the server part of our lesson. Let's go on with the client.

 

The Client

First we must get the interface description from the webserver. In your webbrowser: Click on the ISOAPAdder WSDL-link and copy the path to the wsdl file. (http://<your server>/cgi-bin/SOAPAdder_cgi.exe/wsdl/ISOAPAdder)

 

Choose File|New|Other, and on the WebServices page, double-click on the WSDL-importer icon. Paste the path from above into the EditBox and click Next and Finish.

 

 

 

You now got a Pascal description file of your interface. Save the file as: ISOAPAdder1.pas. Place it in the same directory as where you wan't the client files.

 

Start a new application. Put three EditBoxes, a label, a button and a HTTPRIO component on the form:

 

 

 

Paste the wsdl-path from above into the HTTPPRIO.WSDLLocation property. Add ISOAPAdder1 to the uses clause, and save the project.

 

Put this code in Unit1:

 

unit Unit1;

 

interface

 

uses

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

  Dialogs, ISOAPAdder1, InvokeRegistry, Rio, SOAPHTTPClient, StdCtrls;

 

type

  TForm1 = class(TForm)

    Edit1: TEdit;

    Edit2: TEdit;

    Edit3: TEdit;

    Button1: TButton;

    Label1: TLabel;

    HTTPRIO1: THTTPRIO;

    procedure Button1Click(Sender: TObject);

  private

    function GetInterface: ISOAPAdder;

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

 

implementation

 

{$R *.dfm}

 

{ TForm1 }

 

function TForm1.GetInterface: ISOAPAdder;

begin

  Result:= HTTPRIO1 as ISOAPAdder;

end;

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  Edit3.Text:= IntToStr(GetInterface.Add(StrToInt(Edit1.Text),StrToInt(Edit2.Text)));

end;

 

end.

 

 

Execute and test your client.

 

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

 

neoturk - ...Client-server with web services ?...

Web Service applications are a special form of Web Server application. Support for Web Services is built on top of the Web Broker architecture. To understand the code that the SOAP Application wizard generates, therefore, it is helpful to understand the Web Broker architecture.

You will need D6 or 7 Enterprise and a webserver for this project.

 

The Server

Start with launching the SOAP application wizard, choose File|New|Other, and on the WebServices page, double-click the Soap Server Application icon.

 

 

 

Choose the type of Web server application you want to use for your Web Service. In our case it will be: CGI stand-alone executable.

 

 

 

 

 

In the "Add New WebService" - dialog, write:

 

 

 

The wizard generates a new Web server application that includes a Web module which contains three components:

 

 

 

An invoker component (THTTPSoapPascalInvoker). The invoker converts between SOAP messages and the methods of any registered invokable interfaces in your Web Service application.

A dispatcher component (THTTPSoapDispatcher). The dispatcher automatically responds to incoming SOAP messages and forwards them to the invoker. You can use its WebDispatch property to identify the HTTP request messages to which your application responds. This involves setting the PathInfo property to indicate the path portion of any URL directed to your application, and the MethodType property to indicate the method header for request messages.

A WSDL publisher (TWSDLHTMLPublish). The WSDL publisher publishes a WSDL document that describes your interfaces and how to call them. The WSDL document tells clients how to call on your Web Service application.

The SOAP dispatcher and WSDL publisher are auto-dispatching components. This means they automatically register themselves with the Web module so that it forwards any incoming requests addressed using the path information they specify in their WebDispatch properties. If you right-click on the Web module, you can see that in addition to these auto-dispatching components, it has a single Web action item named DefaultHandler.

 

DefaultHandler is the default action item. That is, if the Web module receives a request for which it can't find a handler (can't match the path information), it forwards that message to the default action item. DefaultHandler generates a Web page that describes your Web Service. To change the default action, edit this action item's OnAction event handler.

 

Let's start some coding. We'll just make a tiny interface to see if things work. By now you should have three units in your project: Unit1, SOAPAdderImpl and SOAPAdderIntf. Place the following code in the implementation unit:

 

{ Invokable implementation File for TSOAPAdder which implements ISOAPAdder }

 

unit SOAPAdderImpl;

 

interface

 

uses InvokeRegistry, Types, XSBuiltIns, SOAPAdderIntf;

 

type

 

  { TSOAPAdder }

  TSOAPAdder = class(TInvokableClass, ISOAPAdder)

  public

    function Add(A, B: integer): integer; stdcall;

  end;

 

implementation

 

{ TSOAPAdder }

 

function TSOAPAdder.Add(A, B: integer): integer;

begin

  Result:= A + B;

end;

 

initialization

  { Invokable classes must be registered }

  InvRegistry.RegisterInvokableClass(TSOAPAdder);

 

end.

 

 

Place the Add-function in the interface unit as well:

 

{ Invokable interface ISOAPAdder }

 

unit SOAPAdderIntf;

 

interface

 

uses InvokeRegistry, Types, XSBuiltIns;

 

type

 

  { Invokable interfaces must derive from IInvokable }

  ISOAPAdder = interface(IInvokable)

  ['{66FAF3AA-0228-47D2-A49A-250D86DE2C98}']

    function Add(A, B: integer): integer; stdcall;

 

    { Methods of Invokable interface must not use the default }

    { calling convention; stdcall is recommended }

  end;

 

implementation

 

initialization

  { Invokable interfaces must be registered }

  InvRegistry.RegisterInterface(TypeInfo(ISOAPAdder));

 

end.

 

 

 

Save your project as: SOAPAdder_cgi.dpr and compile it. You should now have a file called: SOAPAdder_cgi.exe in your project folder. Copy this file to your webserver's library /cgi-bin

 

You should be able to see a description of your interface at: http://<your server>/cgi-bin/SOAPAdder_cgi.exe

 

 

 

This completes the server part of our lesson. Let's go on with the client.

 

The Client

First we must get the interface description from the webserver. In your webbrowser: Click on the ISOAPAdder WSDL-link and copy the path to the wsdl file. (http://<your server>/cgi-bin/SOAPAdder_cgi.exe/wsdl/ISOAPAdder)

 

Choose File|New|Other, and on the WebServices page, double-click on the WSDL-importer icon. Paste the path from above into the EditBox and click Next and Finish.

 

 

 

You now got a Pascal description file of your interface. Save the file as: ISOAPAdder1.pas. Place it in the same directory as where you wan't the client files.

 

Start a new application. Put three EditBoxes, a label, a button and a HTTPRIO component on the form:

 

 

 

Paste the wsdl-path from above into the HTTPPRIO.WSDLLocation property. Add ISOAPAdder1 to the uses clause, and save the project.

 

Put this code in Unit1:

 

unit Unit1;

 

interface

 

uses

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

  Dialogs, ISOAPAdder1, InvokeRegistry, Rio, SOAPHTTPClient, StdCtrls;

 

type

  TForm1 = class(TForm)

    Edit1: TEdit;

    Edit2: TEdit;

    Edit3: TEdit;

    Button1: TButton;

    Label1: TLabel;

    HTTPRIO1: THTTPRIO;

    procedure Button1Click(Sender: TObject);

  private

    function GetInterface: ISOAPAdder;

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

 

implementation

 

{$R *.dfm}

 

{ TForm1 }

 

function TForm1.GetInterface: ISOAPAdder;

begin

  Result:= HTTPRIO1 as ISOAPAdder;

end;

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  Edit3.Text:= IntToStr(GetInterface.Add(StrToInt(Edit1.Text),StrToInt(Edit2.Text)));

end;

 

end.

 

 

Execute and test your client.

 

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

 

neoturk - ...Webbrooker test-cgi ?...

In web-programming it could sometimes be useful to have a testapplication to send webrequests to. This cgi-application will brake down the request message into it's pieces.

 

Here is a sample output:

 

Response.cgi

 

You where sending this request to the webserver (localhost):

Post method content:

Get method content: Span=0 From=2004-09-04 00:00:00 To=2004-09-04 00:00:00 Cat=Internet access Status=1

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

 

CookieFields: ASP.NET_SessionId=3rk4hymxeczm0f45dzvies32

URL:

ProtocolVersion:  HTTP/1.1

Method: GET

PathInfo:

PathTranslated: c:inetpubwwwroot

Authorization:

CacheControl:

Accept: */*

From:

Host: localhost

Referer:

UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)

ContentEncoding:

ContentType:

ContentVersion:

Connection: Keep-Alive

DerivedFrom :

Title:

RemoteAddr: 127.0.0.1

RemoteHost: 127.0.0.1

ScriptName: /cgi-bin/response.cgi

InternalPathInfo:

InternalScriptName: /cgi-bin/response.cgi

 

 

And here is the code. Start a new web project by selecting: File/New/Other/Web Server Application/cgi Stand Alone Executable. Then put this code into Unit1:

 

 

 

unit Unit1;

 

interface

 

uses

  SysUtils, Classes, HTTPApp;

 

type

  TWebModule1 = class(TWebModule)

    procedure WebModule1WebActionItem1Action(Sender: TObject;

      Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  WebModule1: TWebModule1;

 

const

  HTML1 = '<tr><td><font face=verdana size=-1 color=black><b>';

  HTML2 = '<td><font face=verdana size=-1 color=black><b>';

 

implementation

 

{$R *.dfm}

 

procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;

  Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

begin

  Response.Content:= '<font face=verdana size=-1 color=blue><b>Response.cgi<br><br>' +

    'You where sending this request to the webserver (' + Request.Host + '):<br>' +

    '<font color=green>Post method content: ' + Request.ContentFields.Text +

    '<br><font color=red>Get method content: ' + Request.QueryFields.Text +

    '<hr width=100%><br><table width=600 border=2 bordercolor=red' +

    HTML1 + 'CookieFields:' +

    HTML2 + Request.CookieFields.Text + '&nbsp;' +

    HTML1 + 'URL:' + '&nbsp;' +

    HTML2 + Request.URL + '&nbsp;' +

    HTML1 + 'ProtocolVersion:' + '&nbsp;' +

    HTML2 + Request.ProtocolVersion + '&nbsp;' +

    HTML1 + 'Method:' +

    HTML2 + Request.Method + '&nbsp;' +

    HTML1 + 'PathInfo:' +

    HTML2 + Request.PathInfo + '&nbsp;' +

    HTML1 + 'PathTranslated:' +

    HTML2 + Request.PathTranslated + '&nbsp;' +

    HTML1 + 'Authorization:' +

    HTML2 + Request.Authorization + '&nbsp;' +

    HTML1 + 'CacheControl:' +

    HTML2 + Request.CacheControl + '&nbsp;' +

    HTML1 + 'Accept:' +

    HTML2 + Request.Accept + '&nbsp;' +

    HTML1 + 'From:' +

    HTML2 + Request.From + '&nbsp;' +

    HTML1 + 'Host:' +

    HTML2 + Request.Host + '&nbsp;' +

    HTML1 + 'Referer:' +

    HTML2 + Request.Referer + '&nbsp;' +

    HTML1 + 'UserAgent:'+

    HTML2 + Request.UserAgent + '&nbsp;' +

    HTML1 + 'ContentEncoding:' +

    HTML2 + Request.ContentEncoding + '&nbsp;' +

    HTML1 + 'ContentType:' +

    HTML2 + Request.ContentType + '&nbsp;' +

    HTML1 + 'ContentVersion:' +

    HTML2 + Request.ContentVersion + '&nbsp;' +

    HTML1 + 'Connection:' +

    HTML2 + Request.Connection + '&nbsp;' +

    HTML1 + 'DerivedFrom:' +

    HTML2 + Request.DerivedFrom + '&nbsp;' +

    HTML1 + 'Title:' +

    HTML2 + Request.Title + '&nbsp;' +

    HTML1 + 'RemoteAddr:' +

    HTML2 + Request.RemoteAddr + '&nbsp;' +

    HTML1 + 'RemoteHost:' +

    HTML2 + Request.RemoteHost + '&nbsp;' +

    HTML1 + 'ScriptName:' +

    HTML2 + Request.ScriptName + '&nbsp;' +

    HTML1 + 'InternalPathInfo:' +

    HTML2 + Request.InternalPathInfo + '&nbsp;' +

    HTML1 + 'InternalScriptName:' +

    HTML2 + Request.InternalScriptName + '&nbsp;' +

    '</table>';

end;

 

end.

 

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

 

neoturk - ...Webbrooker test-cgi ?...

In web-programming it could sometimes be useful to have a testapplication to send webrequests to. This cgi-application will brake down the request message into it's pieces.

 

Here is a sample output:

 

Response.cgi

 

You where sending this request to the webserver (localhost):

Post method content:

Get method content: Span=0 From=2004-09-04 00:00:00 To=2004-09-04 00:00:00 Cat=Internet access Status=1

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

 

CookieFields: ASP.NET_SessionId=3rk4hymxeczm0f45dzvies32

URL:

ProtocolVersion:  HTTP/1.1

Method: GET

PathInfo:

PathTranslated: c:inetpubwwwroot

Authorization:

CacheControl:

Accept: */*

From:

Host: localhost

Referer:

UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)

ContentEncoding:

ContentType:

ContentVersion:

Connection: Keep-Alive

DerivedFrom :

Title:

RemoteAddr: 127.0.0.1

RemoteHost: 127.0.0.1

ScriptName: /cgi-bin/response.cgi

InternalPathInfo:

InternalScriptName: /cgi-bin/response.cgi

 

 

And here is the code. Start a new web project by selecting: File/New/Other/Web Server Application/cgi Stand Alone Executable. Then put this code into Unit1:

 

 

 

unit Unit1;

 

interface

 

uses

  SysUtils, Classes, HTTPApp;

 

type

  TWebModule1 = class(TWebModule)

    procedure WebModule1WebActionItem1Action(Sender: TObject;

      Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  WebModule1: TWebModule1;

 

const

  HTML1 = '<tr><td><font face=verdana size=-1 color=black><b>';

  HTML2 = '<td><font face=verdana size=-1 color=black><b>';

 

implementation

 

{$R *.dfm}

 

procedure TWebModule1.WebModule1WebActionItem1Action(Sender: TObject;

  Request: TWebRequest; Response: TWebResponse; var Handled: Boolean);

begin

  Response.Content:= '<font face=verdana size=-1 color=blue><b>Response.cgi<br><br>' +

    'You where sending this request to the webserver (' + Request.Host + '):<br>' +

    '<font color=green>Post method content: ' + Request.ContentFields.Text +

    '<br><font color=red>Get method content: ' + Request.QueryFields.Text +

    '<hr width=100%><br><table width=600 border=2 bordercolor=red' +

    HTML1 + 'CookieFields:' +

    HTML2 + Request.CookieFields.Text + '&nbsp;' +

    HTML1 + 'URL:' + '&nbsp;' +

    HTML2 + Request.URL + '&nbsp;' +

    HTML1 + 'ProtocolVersion:' + '&nbsp;' +

    HTML2 + Request.ProtocolVersion + '&nbsp;' +

    HTML1 + 'Method:' +

    HTML2 + Request.Method + '&nbsp;' +

    HTML1 + 'PathInfo:' +

    HTML2 + Request.PathInfo + '&nbsp;' +

    HTML1 + 'PathTranslated:' +

    HTML2 + Request.PathTranslated + '&nbsp;' +

    HTML1 + 'Authorization:' +

    HTML2 + Request.Authorization + '&nbsp;' +

    HTML1 + 'CacheControl:' +

    HTML2 + Request.CacheControl + '&nbsp;' +

    HTML1 + 'Accept:' +

    HTML2 + Request.Accept + '&nbsp;' +

    HTML1 + 'From:' +

    HTML2 + Request.From + '&nbsp;' +

    HTML1 + 'Host:' +

    HTML2 + Request.Host + '&nbsp;' +

    HTML1 + 'Referer:' +

    HTML2 + Request.Referer + '&nbsp;' +

    HTML1 + 'UserAgent:'+

    HTML2 + Request.UserAgent + '&nbsp;' +

    HTML1 + 'ContentEncoding:' +

    HTML2 + Request.ContentEncoding + '&nbsp;' +

    HTML1 + 'ContentType:' +

    HTML2 + Request.ContentType + '&nbsp;' +

    HTML1 + 'ContentVersion:' +

    HTML2 + Request.ContentVersion + '&nbsp;' +

    HTML1 + 'Connection:' +

    HTML2 + Request.Connection + '&nbsp;' +

    HTML1 + 'DerivedFrom:' +

    HTML2 + Request.DerivedFrom + '&nbsp;' +

    HTML1 + 'Title:' +

    HTML2 + Request.Title + '&nbsp;' +

    HTML1 + 'RemoteAddr:' +

    HTML2 + Request.RemoteAddr + '&nbsp;' +

    HTML1 + 'RemoteHost:' +

    HTML2 + Request.RemoteHost + '&nbsp;' +

    HTML1 + 'ScriptName:' +

    HTML2 + Request.ScriptName + '&nbsp;' +

    HTML1 + 'InternalPathInfo:' +

    HTML2 + Request.InternalPathInfo + '&nbsp;' +

    HTML1 + 'InternalScriptName:' +

    HTML2 + Request.InternalScriptName + '&nbsp;' +

    '</table>';

end;

 

end.

 

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

 

Query’e SQL komutu yazmak ve işlemesini sağlamak.

Kayıt Eklemek İçin

 

 

 

 

Query1.Close;

 

 

Query1.SQL.Clear;

 

 

Query1.SQL.Add('update urun');

 

 

query1.sql.Add('set urunadedi=urunadedi+');

 

 

query1.sql.add(#39+edit1.text+#39);

 

 

query1.ExecSQL;

 

 

 

 

#39 ifadesi işaretini ifade etmektedir. ‘ işareti kullanmadık çünkü o zaman

edit1.text in içindeki yazıyı değil de Edit1.texti yazı olarak görür.

 

 

 

 

Listelerken

 

 

 

 

Query1.Close;

 

 

Query1.SQL.Clear;

 

 

Query1.SQL.Add('select * from urun');

 

 

query1.open;

 

 

Gerisi SQL bilginize kalmış.  Query1.SQL.Add den sonra istediğiniz SQL komutunu

yazabilirsiniz.Bir buttonun on clickine yazabilirsiniz.

 

 kaynak : http://turkdelphi.cjb.net/

 

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

 

Query’e SQL komutu yazmak ve işlemesini sağlamak.

Kayıt Eklemek İçin

 

 

 

 

Query1.Close;

 

 

Query1.SQL.Clear;

 

 

Query1.SQL.Add('update urun');

 

 

query1.sql.Add('set urunadedi=urunadedi+');

 

 

query1.sql.add(#39+edit1.text+#39);

 

 

query1.ExecSQL;

 

 

 

 

#39 ifadesi işaretini ifade etmektedir. ‘ işareti kullanmadık çünkü o zaman

edit1.text in içindeki yazıyı değil de Edit1.texti yazı olarak görür.

 

 

 

 

Listelerken

 

 

 

 

Query1.Close;

 

 

Query1.SQL.Clear;

 

 

Query1.SQL.Add('select * from urun');

 

 

query1.open;

 

 

Gerisi SQL bilginize kalmış.  Query1.SQL.Add den sonra istediğiniz SQL komutunu

yazabilirsiniz.Bir buttonun on clickine yazabilirsiniz.

 

 kaynak : http://turkdelphi.cjb.net/

 

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

 

ADO KULLANILIŞI

//adotable i nasıl bağlarız. adotable bağlanınca alians oluşturmaya gerek kalmaz.

Access veri dosyaları programda kullanılabilir.

 

 

//ben adotable ile yaptım isteyen Table ile yapabilir. adotable yazan yerleri

table yapmanız yeterli olacaktır. Adotable i bağlamak için ADO sekmesinden

adocennection koyulur. Bunun connection sctingi tıklanır. Use connection

string işaretlenir. ve Build e basılır. Microsoft Jet 4.0 OLE DB Proviev

seçilir. İleri denir.Veri tabanı seçin yada adını girin bölümünün yanındaki ...

ya basılarak veri tabanının yeri saptanır. .MDB uzantılı!!!! Daha sonra aç-tamam-ok

butonlarına basılır.loginpromtu false yapılır yapmazsanız şifre ekreni gelir

eğer şifre belirtmediyseniz bir şey yazmadan ok deyin bişey yazarsanız çalışmaz

Ado sekmesinden adotable i konulur. Connectionu ADOConection1 yapılır. Table name i

seçilir. Active i True yapılır.Datasource'ün dataset'i ADOTable1 yapılır.

 

 

//form şifre ile açılsın isterseniz geliştirebilirsiniz!!!!!

 

 

// üç bölümlü database oluşturun

//Access veri tabanında  kullaniciadi , sifre ,seviye diye. Kullanicini adını

anahtar sütun yaparak bir tablo oluşturun.. İlk sütuna kullanici adı girin ,

ikinciye şifreyi ,3.yede Admin diye veri girişi yapın

 

 

//iki tane form oluşturun. Birincisine

//iki edit ve bir buton koyun butonun onclickine aşağıdakileri yazın

 

 

//butona tıklandığında begin ile end in arasına yapıştırabilirsiniz.

 

adotable1.filter:='Kullaniciadi='+#39+edit1.text+#39;   //edit1 de yazan yazıyı

kullanici adı sütununda taratıyoruz.

adotable1.filtered:=True; //Filtrele ,sonuçları göster dedik.

 

if adotable1.Fields.Fields[0].value=Edit1.text then //edit1 deki değeri tablonun  ilk sütununda ara ve doğrusu ise bir alt satıra geç

if adotable1.fields.fields[2].value='admin' then //kullanici adi girilen kişinin admin olup olmadığını 3. sütundan bakıyoruz. Admin ise Bir sonraki İşlemi yap 1.Döngü açıldı eğer admin değilse en sondaki else ye kadar git!!!!

begin //2. olay oluyor

if adotable1.Fields.Fields[0].value=Edit1.text then // edit1.text te yazan yazıyı

sütun birde ara

if adotable1.Fields.Fields[1].value=Edit2.text then // edit2 deki yazıyı tablonunşifre sütunundaki ile karşılaştır doğruysa alttaki işleme geç 2. Döngü açıldı eğer yanlışsa 2.olay bitmeden önceki son  else ye kadar atla!!!

begin //3. olay oluyor

if adotable1.fields.fields[2].value='admin' then // bak bakalım bu adam adminmi? admin ise aşşa geç  3.döngü açıldı eğer yanlış ise 3. olay bitmeden önceki son  else ye kadar atla!!!!

begin //4. olaya başla

form2.show; // En sonunda sora sora bağdatı bulduk açıldı form2

form1.Visible:=false; //form1 i gizledik. Form2 nin Onclose una halt; yazın yoksa program kapanmaz!!!!

adotable1.Filtered:=False; // filtrelemeyi iptal et

end //4. olayı bitir

else

showmessage('Admin Değilsiniz lütfen Yetki Alanınızdan Giriş Yapınız');  // 3.döngü geri geldi. Bu adam yanlış yapmış

end //3. olayı bitir

else

showmessage('Şifrenizi Hatalı Girdiniz')  // 2.Döngü geri geldi bu adam yanlış şifre girmiş!!!

end //2. olayı bitir

else

showmessage('Kullanıcı Adınızı Hatalı Girdiniz') //1.Döngü Geri geldi bu adamın kullanıcı adı veritabanında yok

 

 

 

 

İsterseniz admin yazdığınız yere master ve user komutlarını da ekleyebilirsiniz.

 Açılışta üç seçenek koyun radiobuton ile ve üç tane buton koyun.

 Seçenekleri admin , master ve user yapın. Birinci seçenek seçilirse. 2. ve3.

 butonun visible sini False yapın. 2. Seçilirse 1 ve 3 ü , 3 seçilirsede 1 ve 2 nin

 visiblesini true yap deyin bu şekilde button2.visible:=True; button2.visible:=False;

 true gösterir false gizler. Bir çok öğe için bu komutu kullanabilirsiniz.

 Çoğunun visible ( görünmezlik ) özelliği vardır. 1. butonun onclickine yukardakini

  aynen yazın. 2 butonun onclikine admin yazan yerleri master yaparak , 3 butonun on

  clickinede admin yazan yerleri user yaparak kaydedin.

  Böylece programınıza giren kişilere yetkiler vermiş olursunuz. Örneğin admin

  olarak kayıtlı olan biri form2 ye girsin yukarda ki gibi master olan kişi

  yaptığında form2 yazan yeri form3.show yapın. Masterlar form 3 e gitsin.

  Aynı şeyi userler içinde yapın onlarda form4 e gitsin.

 

 

kaynak :www.ucretsizyazilim.com

 

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

 

ADO KULLANILIŞI

//adotable i nasıl bağlarız. adotable bağlanınca alians oluşturmaya gerek kalmaz.

Access veri dosyaları programda kullanılabilir.

 

 

//ben adotable ile yaptım isteyen Table ile yapabilir. adotable yazan yerleri

table yapmanız yeterli olacaktır. Adotable i bağlamak için ADO sekmesinden

adocennection koyulur. Bunun connection sctingi tıklanır. Use connection

string işaretlenir. ve Build e basılır. Microsoft Jet 4.0 OLE DB Proviev

seçilir. İleri denir.Veri tabanı seçin yada adını girin bölümünün yanındaki ...

ya basılarak veri tabanının yeri saptanır. .MDB uzantılı!!!! Daha sonra aç-tamam-ok

butonlarına basılır.loginpromtu false yapılır yapmazsanız şifre ekreni gelir

eğer şifre belirtmediyseniz bir şey yazmadan ok deyin bişey yazarsanız çalışmaz

Ado sekmesinden adotable i konulur. Connectionu ADOConection1 yapılır. Table name i

seçilir. Active i True yapılır.Datasource'ün dataset'i ADOTable1 yapılır.

 

 

//form şifre ile açılsın isterseniz geliştirebilirsiniz!!!!!

 

 

// üç bölümlü database oluşturun

//Access veri tabanında  kullaniciadi , sifre ,seviye diye. Kullanicini adını

anahtar sütun yaparak bir tablo oluşturun.. İlk sütuna kullanici adı girin ,

ikinciye şifreyi ,3.yede Admin diye veri girişi yapın

 

 

//iki tane form oluşturun. Birincisine

//iki edit ve bir buton koyun butonun onclickine aşağıdakileri yazın

 

 

//butona tıklandığında begin ile end in arasına yapıştırabilirsiniz.

 

adotable1.filter:='Kullaniciadi='+#39+edit1.text+#39;   //edit1 de yazan yazıyı

kullanici adı sütununda taratıyoruz.

adotable1.filtered:=True; //Filtrele ,sonuçları göster dedik.

 

if adotable1.Fields.Fields[0].value=Edit1.text then //edit1 deki değeri tablonun  ilk sütununda ara ve doğrusu ise bir alt satıra geç

if adotable1.fields.fields[2].value='admin' then //kullanici adi girilen kişinin admin olup olmadığını 3. sütundan bakıyoruz. Admin ise Bir sonraki İşlemi yap 1.Döngü açıldı eğer admin değilse en sondaki else ye kadar git!!!!

begin //2. olay oluyor

if adotable1.Fields.Fields[0].value=Edit1.text then // edit1.text te yazan yazıyı

sütun birde ara

if adotable1.Fields.Fields[1].value=Edit2.text then // edit2 deki yazıyı tablonunşifre sütunundaki ile karşılaştır doğruysa alttaki işleme geç 2. Döngü açıldı eğer yanlışsa 2.olay bitmeden önceki son  else ye kadar atla!!!

begin //3. olay oluyor

if adotable1.fields.fields[2].value='admin' then // bak bakalım bu adam adminmi? admin ise aşşa geç  3.döngü açıldı eğer yanlış ise 3. olay bitmeden önceki son  else ye kadar atla!!!!

begin //4. olaya başla

form2.show; // En sonunda sora sora bağdatı bulduk açıldı form2

form1.Visible:=false; //form1 i gizledik. Form2 nin Onclose una halt; yazın yoksa program kapanmaz!!!!

adotable1.Filtered:=False; // filtrelemeyi iptal et

end //4. olayı bitir

else

showmessage('Admin Değilsiniz lütfen Yetki Alanınızdan Giriş Yapınız');  // 3.döngü geri geldi. Bu adam yanlış yapmış

end //3. olayı bitir

else

showmessage('Şifrenizi Hatalı Girdiniz')  // 2.Döngü geri geldi bu adam yanlış şifre girmiş!!!

end //2. olayı bitir

else

showmessage('Kullanıcı Adınızı Hatalı Girdiniz') //1.Döngü Geri geldi bu adamın kullanıcı adı veritabanında yok

 

 

 

 

İsterseniz admin yazdığınız yere master ve user komutlarını da ekleyebilirsiniz.

 Açılışta üç seçenek koyun radiobuton ile ve üç tane buton koyun.

 Seçenekleri admin , master ve user yapın. Birinci seçenek seçilirse. 2. ve3.

 butonun visible sini False yapın. 2. Seçilirse 1 ve 3 ü , 3 seçilirsede 1 ve 2 nin

 visiblesini true yap deyin bu şekilde button2.visible:=True; button2.visible:=False;

 true gösterir false gizler. Bir çok öğe için bu komutu kullanabilirsiniz.

 Çoğunun visible ( görünmezlik ) özelliği vardır. 1. butonun onclickine yukardakini

  aynen yazın. 2 butonun onclikine admin yazan yerleri master yaparak , 3 butonun on

  clickinede admin yazan yerleri user yaparak kaydedin.

  Böylece programınıza giren kişilere yetkiler vermiş olursunuz. Örneğin admin

  olarak kayıtlı olan biri form2 ye girsin yukarda ki gibi master olan kişi

  yaptığında form2 yazan yeri form3.show yapın. Masterlar form 3 e gitsin.

  Aynı şeyi userler içinde yapın onlarda form4 e gitsin.

 

 

kaynak :www.ucretsizyazilim.com

 

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

 

' işareti

' ( tırnak )

 

 

 

 

 

 

İşte bence çok gerekli bir şey ' işareti. şimdi kesin ne alaka diyorsunuz.

İşte sql ve delphinin bazı basit fakat anlaşılmaz olaylarından bir tanesi.

Mesela edit1 in text ini SQL komutu ile nasıl yazdıra biliriz yada edit1 den

nasıl yararlanabiliriz.

 

 

 

 

 

Yanlış

 

 

 

query1.Close;

query1.SQL.clear;

query1.sql.add('select * from tablo  where tabloadi=');

query1.sql.add('edit1.text');

query1.open;

 

 

 

 

Neden yanlış ? edit1.text in önünde ve sonunda ' (Tırnak) var. Edit1.text yazısını

arıyor ama bulamıyor.Biz edit1 in içine yazdığımız yazıyı aramasını istiyoruz.

Peki tırnağı kaldırınca da gene olmuyor. İşte burada asci denen bilgisayar kodları

giriyor devreye. Bunlar bilgisayarın şekillere , sayılara , rakamlara karşılık

gelen sayılardır. bizimki #39 neden #39 aslında 39 ama Delphi'de kullanabilmek

için önüne # koymamız gerekiyor. Her hangi bir yazı yazma aracı açın örn: word ,

frontpage vs. alt'a basılı tutup 169 yazın ® olması lazım. 39 yazınca da '

bu olmalı. Zevkli değil mi :=) şimdi siz 0 dan 300 e kadar takılın :=) .

Değişik ve güzel şeyler keşfede bilirsiniz. En son şapkayı bulmuştum :=) .

Neyse konumuza geri dönelim.  Alt'a basılı tutmayı unutmayın.

 

 

 

 

Doğru

 

 

query1.Close;

query1.SQL.clear;

query1.sql.add('select * from tablo  where tabloadi=');

query1.sql.add(#39+edit1.text+#39);

query1.open;

 

 

 

 

+ da ekle demek. Sonuna ekliyor. Yani 'edit1.text' oluyor. ne koyarsan yanına

yaz demek. 'Ahmet'+'mehmet' yazınca Ahmetmehmet yazar 'Ahmet'+'  '+'mehmet'

yazarsak Ahmet  mehmet yazacaktır. Çok işinize yaraya bilir. Benim çok işime yarıyor.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

kaynak: www.ucretsizyazilim.com

 

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

 

' işareti

' ( tırnak )

 

 

 

 

 

 

İşte bence çok gerekli bir şey ' işareti. şimdi kesin ne alaka diyorsunuz.

İşte sql ve delphinin bazı basit fakat anlaşılmaz olaylarından bir tanesi.

Mesela edit1 in text ini SQL komutu ile nasıl yazdıra biliriz yada edit1 den

nasıl yararlanabiliriz.

 

 

 

 

 

Yanlış

 

 

 

query1.Close;

query1.SQL.clear;

query1.sql.add('select * from tablo  where tabloadi=');

query1.sql.add('edit1.text');

query1.open;

 

 

 

 

Neden yanlış ? edit1.text in önünde ve sonunda ' (Tırnak) var. Edit1.text yazısını

arıyor ama bulamıyor.Biz edit1 in içine yazdığımız yazıyı aramasını istiyoruz.

Peki tırnağı kaldırınca da gene olmuyor. İşte burada asci denen bilgisayar kodları

giriyor devreye. Bunlar bilgisayarın şekillere , sayılara , rakamlara karşılık

gelen sayılardır. bizimki #39 neden #39 aslında 39 ama Delphi'de kullanabilmek

için önüne # koymamız gerekiyor. Her hangi bir yazı yazma aracı açın örn: word ,

frontpage vs. alt'a basılı tutup 169 yazın ® olması lazım. 39 yazınca da '

bu olmalı. Zevkli değil mi :=) şimdi siz 0 dan 300 e kadar takılın :=) .

Değişik ve güzel şeyler keşfede bilirsiniz. En son şapkayı bulmuştum :=) .

Neyse konumuza geri dönelim.  Alt'a basılı tutmayı unutmayın.

 

 

 

 

Doğru

 

 

query1.Close;

query1.SQL.clear;

query1.sql.add('select * from tablo  where tabloadi=');

query1.sql.add(#39+edit1.text+#39);

query1.open;

 

 

 

 

+ da ekle demek. Sonuna ekliyor. Yani 'edit1.text' oluyor. ne koyarsan yanına

yaz demek. 'Ahmet'+'mehmet' yazınca Ahmetmehmet yazar 'Ahmet'+'  '+'mehmet'

yazarsak Ahmet  mehmet yazacaktır. Çok işinize yaraya bilir. Benim çok işime yarıyor.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

kaynak: www.ucretsizyazilim.com

 

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

 

neoturk - re: mcsd

iskenderrr arkadaşım yazmışsınız ki:

"

önümüzdeki 3-5 ay boyunca her yazısında kendisinin .msda öğrencisi olduğunu

söyleyecektir. (artık orayı bitirince kaç sene konuşur bilinmez)

"

 

cevabım:

 

bunun sende neden rahatsızlık uyandırdığına anlam veremedim.

 

"meyve veren ağaç taşlanır" sözü geçer li olabilir sanırım..

 

belki de hızlı yazdığım için "msda" kelimesine kızmış olabilirsin,

düzeltiyorum, "mcsd" olacaktı, kusura bakma kardeş....

 

göreceğim konular aşağıda:

 

.NET programlama dilleri, Visual Basic.NET, ASP.NET, ADO.NET

.Internet Programcılığı

.Object Oriented modelleme ve tasarım teknikleri

.COM +, Remoting IIS 6.0

.XML Web Servisleri

.XML

.Visual Studio .NET

.NET Framework

.Veritabanı prensipleri, prosedürleri ve performans faktörleri

.MS Access, SQL Server gibi çeşitli büyüklükteki veri tabanı programları

.Veritabanı ve yazılım güvenlik prosedürleri ve stratejileri

lişkisel Veritabanı Teorisi

.Projelendirme ve problem çözme teknikleri

 

çoğunu zaten delphi ortamında kullanmaya çalışıyorum...

amacım sadece bu sertifikayı almak.

 

dediğin gibi, burayı bitirince,

 

delphi platformunda ben de bilmiyorum,

 

kaç sene konuşacağımı...........

 

belki bu sayısı bilinmeyen seneler içerisinde

bildiklerimi paylaşırım ne dersin...

 

saygılarımla_

 

neoturk

 

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

 

neoturk - re: mcsd

iskenderrr arkadaşım yazmışsınız ki:

"

önümüzdeki 3-5 ay boyunca her yazısında kendisinin .msda öğrencisi olduğunu

söyleyecektir. (artık orayı bitirince kaç sene konuşur bilinmez)

"

 

cevabım:

 

bunun sende neden rahatsızlık uyandırdığına anlam veremedim.

 

"meyve veren ağaç taşlanır" sözü geçer li olabilir sanırım..

 

belki de hızlı yazdığım için "msda" kelimesine kızmış olabilirsin,

düzeltiyorum, "mcsd" olacaktı, kusura bakma kardeş....

 

göreceğim konular aşağıda:

 

.NET programlama dilleri, Visual Basic.NET, ASP.NET, ADO.NET

.Internet Programcılığı

.Object Oriented modelleme ve tasarım teknikleri

.COM +, Remoting IIS 6.0

.XML Web Servisleri

.XML

.Visual Studio .NET

.NET Framework

.Veritabanı prensipleri, prosedürleri ve performans faktörleri

.MS Access, SQL Server gibi çeşitli büyüklükteki veri tabanı programları

.Veritabanı ve yazılım güvenlik prosedürleri ve stratejileri

lişkisel Veritabanı Teorisi

.Projelendirme ve problem çözme teknikleri

 

çoğunu zaten delphi ortamında kullanmaya çalışıyorum...

amacım sadece bu sertifikayı almak.

 

dediğin gibi, burayı bitirince,

 

delphi platformunda ben de bilmiyorum,

 

kaç sene konuşacağımı...........

 

belki bu sayısı bilinmeyen seneler içerisinde

bildiklerimi paylaşırım ne dersin...

 

saygılarımla_

 

neoturk

 

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

 

neoturk - re: bir eleştiri de neoturke

yavuzyavuz arkadaşım demişsiniz ki:

 

"

{Kardesim;

 

Siz bagirmiyormuydunuz burasi forum degil soru sorma yeridegil .... degil diye?

 

Burasi kitap elestiri forumuda degil.

 

Sizin kitap elestiriniz sahsen beni hic mi hic ilgilendirmiyor, kaldiki

elestirdiginiz konular basit dizgi hatalari olabilecegi gibi yoruma acik

konulardan olusuyor.

 

Soru soranlara 10 kisi soru sorma diye cevap veriyor luzumsuz 11 tane kayit

olusuyor. Salakca sorulari duymayin kardesim cevapta yazmayin silin gitsin,

cevap verenlerede saygi gosterin.

 

 

Hemen cevap yazma, bir on dakika dusun yazacaksan sonra yaz.

 

Saygilar.

}

"

 

cevabım:

 

evet haklısınız, burası forum değil diye bağırmıştım defalarca.

yerden göğe kadar da haklısınız.

 

ancak, zaman içersinde kuralların ihlal edilip, gereksiz sorularla ve istemeyerek

girilen polemiklerle burasının dolup taşması, ve benim de yangına körükle gitmem,

makale yazılar ( benimkiler de dahil ) ile dolmasına neden olmuştur.

 

gönül isterdi ki, gereksiz sorular admin tarafından önlenilsin...

 

ama defalarca vurgulamaya çalıştığım "gereksiz sorularla" buranın şişirilmesinin

bu denli polemik sorulara yol açacağını göstermek idi.

 

saygılarımla_

 

neoturk

 

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

 

neoturk - re: bir eleştiri de neoturke

yavuzyavuz arkadaşım demişsiniz ki:

 

"

{Kardesim;

 

Siz bagirmiyormuydunuz burasi forum degil soru sorma yeridegil .... degil diye?

 

Burasi kitap elestiri forumuda degil.

 

Sizin kitap elestiriniz sahsen beni hic mi hic ilgilendirmiyor, kaldiki

elestirdiginiz konular basit dizgi hatalari olabilecegi gibi yoruma acik

konulardan olusuyor.

 

Soru soranlara 10 kisi soru sorma diye cevap veriyor luzumsuz 11 tane kayit

olusuyor. Salakca sorulari duymayin kardesim cevapta yazmayin silin gitsin,

cevap verenlerede saygi gosterin.

 

 

Hemen cevap yazma, bir on dakika dusun yazacaksan sonra yaz.

 

Saygilar.

}

"

 

cevabım:

 

evet haklısınız, burası forum değil diye bağırmıştım defalarca.

yerden göğe kadar da haklısınız.

 

ancak, zaman içersinde kuralların ihlal edilip, gereksiz sorularla ve istemeyerek

girilen polemiklerle burasının dolup taşması, ve benim de yangına körükle gitmem,

makale yazılar ( benimkiler de dahil ) ile dolmasına neden olmuştur.

 

gönül isterdi ki, gereksiz sorular admin tarafından önlenilsin...

 

ama defalarca vurgulamaya çalıştığım "gereksiz sorularla" buranın şişirilmesinin

bu denli polemik sorulara yol açacağını göstermek idi.

 

saygılarımla_

 

neoturk

 

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

 

neoturk - re: neoturk için

P,ICE arkadaşım demişsiniz ki:

"

(* Öncelikle Verdiğim Rahatsızlık İçin Herkesten Özür Dilerim *)

Gerçekten güzel yazmışsın. seninle tanışmayı çok isterdim. azimlisin, anlattığın kadarıyla da bilgilisin.

kızma ama testlerinin saçma olduğu konusunda halen fikrim değişmiş değil, tabi bu benim için geçerli.

ama tanımadığın bir insanın, sırf burda birşeyler yayınlamadı diye onun bilgisi hakkında yorum yapman

tuhaf birşey. delphi hakkında fazla bilgim yok (ileri düzeyde)bu doğru, ama C'den pek farklı bir dil değil.

 

bu arada aşağıda yazdıklarına karşılık en azından sana ne iş yaptığımı söyleyim. umarım cevabımla

az da olsa, bilgi derecemi ve sana ilk yazdığım metinden rahatsız olan birinin, olgunlukla mı yoksa acemiliklemi

o tepkiyi verdiğini anlarsın.

yaklaşık 2 senedir Google'da yazılım mühendisliği yapıyorum. sanırım bu yeterince açık olmuştur.

 

bu arada, gecelerce uğraşarak bulduğun kodu paylaşmanı tavsiye ederim. eğer bu şekilde örnek olmaya başlarsan,

eminim ilerde bilmediğin bir konu için yine gecelerce uğraşamak zorunda kalmayacaksındır.

 

umarım bu yazdıracağın son metin olur. daha fazla rahatsızlık vermek istemiyorum.

 

kendine iyi bak, Sevgilerimle..

 

*****

test sorularıma "saçma diyebilecek cesareti" kendisinde bulan bir programcı

arkadaşım olarak ( ki henüz tanışmıyoruz ) senin programlama kültürü ile

yeni tanıştığın kanaatindeyim.

 

delphi konusunu bir yana bırakalım, testleri de bir yana bırakalım,

yeterince programlama kitabı okuduğunu dahi sanmıyorum.

***

"

 

cevabım:

 

öncelikle yaptığınız açıklama için ben teşekkür ederim.

 

polemiğimizi bu denli uzatmak istemezdim, cevabınıza iade-i cevap yazmak istedim.

 

test sorularım hakkında fikirlerinizin değişmemiş olmasına saygı duyuyorum.

test sorularımda vurgulamak istediğim "algoritma becerisi" idi.

 

yazılım mühendisliği ile uğraşıyor olmanız dahi, algoritma becerinizin ilerlemiş olması gerektiğine dair

bir inancım vardı. bu yüzden "programlama kültürü ile yeni tanıştığınız kanaatindeyim" cümlesini kullanmıştım.

 

söylemek istediğim, "algoritma becerisi" ile kullandığınız dil arasında herhangi bir bağın olmaması idi.

 

yani "algoritma becerisi" güçlü olan bir programcı her dilde bu işi yapabilir.

gerisi teknik bir konudur.

 

en azından şunu söylemek istiyorum madem yazılım mühendisliği ile uğraşıyorsanız ki iyi bilirsiniz,

 

"program yazan programcıklar" mutlaka ve mutlaka yazmışsınızdır. Bilhassa da veri tabanı sql cümleciklerinde.

 

binlerce satırdan oluşan sizin yazdığınız kodu sizden başka daha iyi yorumlayan ve anlayan olamaz, çünkü siz oturup

sıfırdan bu kodu yazmışsınızdır.

 

daha sonra da program içersinde bazı değişiklikler yapmak istediğinizde,

yeri gelir zorlanırsınız,

yeri gelir yeni tekniklerle esnek hale getirir ve kodu estetik hale getirirsiniz.

bu söylediğim işlemi kesinlikle ve kesinlikle mutlaka yapmışsınızdır. yapmadım deMEMelisiniz kanısındayım.

 

işte bu tecrübenizde dahi, belli bir "algoritma becerisi" kullanmışsınızdır.

 

test sorularımın ( özellikle coder test 3 ) mantık kurma becerileri konusunda ben diyorum ki,

o soruların mantığını kurup,

"kullandığı dil her ne olursa olsun",

"programlayabilen" kişi

her türlü istek programı da rahatlıkla programlayabilir.

( dizilerle ve matrislerle uğraşıyorsanız bilhaassa ne demek istediğimi gayet anlamışsınızdır )

 

 

vurgulamak istediğim buydu....

 

kod paylaşma konusuna gelince,

açıkça belirtmek istiyorum ki, çok zor elde ettiğim kendi buluşumu çok kolay bir şekilde açık kaynak kodunu

buraya yazamam, yazmak da istemem... bilgimi bir yere kadar paylaşırım.

 

hayat acımasız, ve bu bilgi birikimi ile hayatımı idame ( yürütme ) ediyorum.

 

"paylaşmak" zorunluluğumun olduğunu düşünmüyorum. bunu siz de iyi biliyorsunuzdur ya da yaşamışsınızdır.

madem ki google de çalışıyorsunuz 2 senedir, ve özel bir sektör konumudur orası,

elbette rekabet ve bilgi kıskançlığı olacaktır...

 

şayet siz, kendi ürettiğiniz tüm kodlarınızı açık bir dille "ben paylaşıyorum ve çok rahatım" diyorsanız,

diyebiliyorsanız, saygı duyarım........

 

düşüncelerimi bu şekilde aktarmak istedim.

 

"iyi dostluklar kavga ile başlar" derler...

 

tanıştığıma ben de memnun oldum P,Ice..

 

sevgiler benden...

 

saygılarımla_

 

neoturk

 

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

 

neoturk - re: neoturk için

P,ICE arkadaşım demişsiniz ki:

"

(* Öncelikle Verdiğim Rahatsızlık İçin Herkesten Özür Dilerim *)

Gerçekten güzel yazmışsın. seninle tanışmayı çok isterdim. azimlisin, anlattığın kadarıyla da bilgilisin.

kızma ama testlerinin saçma olduğu konusunda halen fikrim değişmiş değil, tabi bu benim için geçerli.

ama tanımadığın bir insanın, sırf burda birşeyler yayınlamadı diye onun bilgisi hakkında yorum yapman

tuhaf birşey. delphi hakkında fazla bilgim yok (ileri düzeyde)bu doğru, ama C'den pek farklı bir dil değil.

 

bu arada aşağıda yazdıklarına karşılık en azından sana ne iş yaptığımı söyleyim. umarım cevabımla

az da olsa, bilgi derecemi ve sana ilk yazdığım metinden rahatsız olan birinin, olgunlukla mı yoksa acemiliklemi

o tepkiyi verdiğini anlarsın.

yaklaşık 2 senedir Google'da yazılım mühendisliği yapıyorum. sanırım bu yeterince açık olmuştur.

 

bu arada, gecelerce uğraşarak bulduğun kodu paylaşmanı tavsiye ederim. eğer bu şekilde örnek olmaya başlarsan,

eminim ilerde bilmediğin bir konu için yine gecelerce uğraşamak zorunda kalmayacaksındır.

 

umarım bu yazdıracağın son metin olur. daha fazla rahatsızlık vermek istemiyorum.

 

kendine iyi bak, Sevgilerimle..

 

*****

test sorularıma "saçma diyebilecek cesareti" kendisinde bulan bir programcı

arkadaşım olarak ( ki henüz tanışmıyoruz ) senin programlama kültürü ile

yeni tanıştığın kanaatindeyim.

 

delphi konusunu bir yana bırakalım, testleri de bir yana bırakalım,

yeterince programlama kitabı okuduğunu dahi sanmıyorum.

***

"

 

cevabım:

 

öncelikle yaptığınız açıklama için ben teşekkür ederim.

 

polemiğimizi bu denli uzatmak istemezdim, cevabınıza iade-i cevap yazmak istedim.

 

test sorularım hakkında fikirlerinizin değişmemiş olmasına saygı duyuyorum.

test sorularımda vurgulamak istediğim "algoritma becerisi" idi.

 

yazılım mühendisliği ile uğraşıyor olmanız dahi, algoritma becerinizin ilerlemiş olması gerektiğine dair

bir inancım vardı. bu yüzden "programlama kültürü ile yeni tanıştığınız kanaatindeyim" cümlesini kullanmıştım.

 

söylemek istediğim, "algoritma becerisi" ile kullandığınız dil arasında herhangi bir bağın olmaması idi.

 

yani "algoritma becerisi" güçlü olan bir programcı her dilde bu işi yapabilir.

gerisi teknik bir konudur.

 

en azından şunu söylemek istiyorum madem yazılım mühendisliği ile uğraşıyorsanız ki iyi bilirsiniz,

 

"program yazan programcıklar" mutlaka ve mutlaka yazmışsınızdır. Bilhassa da veri tabanı sql cümleciklerinde.

 

binlerce satırdan oluşan sizin yazdığınız kodu sizden başka daha iyi yorumlayan ve anlayan olamaz, çünkü siz oturup

sıfırdan bu kodu yazmışsınızdır.

 

daha sonra da program içersinde bazı değişiklikler yapmak istediğinizde,

yeri gelir zorlanırsınız,

yeri gelir yeni tekniklerle esnek hale getirir ve kodu estetik hale getirirsiniz.

bu söylediğim işlemi kesinlikle ve kesinlikle mutlaka yapmışsınızdır. yapmadım deMEMelisiniz kanısındayım.

 

işte bu tecrübenizde dahi, belli bir "algoritma becerisi" kullanmışsınızdır.

 

test sorularımın ( özellikle coder test 3 ) mantık kurma becerileri konusunda ben diyorum ki,

o soruların mantığını kurup,

"kullandığı dil her ne olursa olsun",

"programlayabilen" kişi

her türlü istek programı da rahatlıkla programlayabilir.

( dizilerle ve matrislerle uğraşıyorsanız bilhaassa ne demek istediğimi gayet anlamışsınızdır )

 

 

vurgulamak istediğim buydu....

 

kod paylaşma konusuna gelince,

açıkça belirtmek istiyorum ki, çok zor elde ettiğim kendi buluşumu çok kolay bir şekilde açık kaynak kodunu

buraya yazamam, yazmak da istemem... bilgimi bir yere kadar paylaşırım.

 

hayat acımasız, ve bu bilgi birikimi ile hayatımı idame ( yürütme ) ediyorum.

 

"paylaşmak" zorunluluğumun olduğunu düşünmüyorum. bunu siz de iyi biliyorsunuzdur ya da yaşamışsınızdır.

madem ki google de çalışıyorsunuz 2 senedir, ve özel bir sektör konumudur orası,

elbette rekabet ve bilgi kıskançlığı olacaktır...

 

şayet siz, kendi ürettiğiniz tüm kodlarınızı açık bir dille "ben paylaşıyorum ve çok rahatım" diyorsanız,

diyebiliyorsanız, saygı duyarım........

 

düşüncelerimi bu şekilde aktarmak istedim.

 

"iyi dostluklar kavga ile başlar" derler...

 

tanıştığıma ben de memnun oldum P,Ice..

 

sevgiler benden...

 

saygılarımla_

 

neoturk

 

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

 

neoturk - re: lutfen bi bakin

Morfin arkadaşım demişsiniz ki:

"

Arkadaşlar burası sizin kişisel tartışma alanınız diil.

Kavga edecekseniz MSN'den edin.

biri öbürene aklını başına al der öbürü ona terbiyeli ol der. Arkadaşlar lütfen.

"

 

cevabım:

 

fikirlerinize kesinlikle katılıyorum.

tabii ki amacımız kavga etmek değil, polemiklerin sayısı arttı ve bu platforma taşındı.

 

bu furya ne kadar devam eder bilinmez ama duruma Admin'in el atmasında fayda görüyorum....

 

saygılarımla_

 

neoturk

 

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

 

neoturk - re: lutfen bi bakin

Morfin arkadaşım demişsiniz ki:

"

Arkadaşlar burası sizin kişisel tartışma alanınız diil.

Kavga edecekseniz MSN'den edin.

biri öbürene aklını başına al der öbürü ona terbiyeli ol der. Arkadaşlar lütfen.

"

 

cevabım:

 

fikirlerinize kesinlikle katılıyorum.

tabii ki amacımız kavga etmek değil, polemiklerin sayısı arttı ve bu platforma taşındı.

 

bu furya ne kadar devam eder bilinmez ama duruma Admin'in el atmasında fayda görüyorum....

 

saygılarımla_

 

neoturk

 

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

 

neoturk - re: gerçekten trojan devri kapandi mi

unreachableboy demişsiniz ki:

 

"

........................................................

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

 

Sevgili neoturk.Kod Bankası kısmında bir kitapla ilgi görüşlerini okudum(tabiiki tamamını diil)...Orada sonlarda Trojanlarla ilgili bir kısım hakkında görüşlerini bildirmişsin(index konusuna katılıyorum).Daha sonra altına zaten trojan devri de kapandı tarzında not düşmüssün.Gerçekten de durum böyle mi?Yani Remote Admin Toollar tarihe mi karışıyor?Bir zamanlar herkesi peşinden koşturan Subsevenlar,Theefler,DeepThroatlar(ProRat diyemicem Çünkü ;

***

birçok hatalarla dolu ve şifreleri almakta kullandıkları pluginler kendilerine ait diil ve VB programlama diliyle yazılmış , command prompt ya da parametre kullanılarak çalıştırılan ve txt dosyasına kaydedilen bilgileri okuyan çalıntı ve ücretli bir RAT.Hataları saymakla bitiremem herhalde ama 1-2 tane söylim.

1-)Dosya Arama bölümünde bulunan dosyalar çok fazla ise Client tarafına eksik geliyor.Deneyin...

2-)Registry Editorde aynı şekilde.Current_Root bi girin.Deneyin...,

3-)File Manager çok uğraşılınca çöküyor...

 

nese fazla uzatmadan konuya dönimm:)

 

***efsaneleri bitiyor mu?Ben de Trojan ve Agent yazdım.

Trojan EditServer hariç hatasız çalışıyor ve ProRatin tüm özelliklerini taşıyor...Şaşırıyor olabilirsiniz.Ama 8 aydır gecemi gündüzüme kattım bunun için...

 

Agent ise tamamiyle bitti ve o da ProAgentın tüm özelliklerinin yanında esktra özellikleri de var.Kısa zamanda nete yaymayı düşünüyorum(tabii üniversiteden vakit bulursam:)

 

Bu 2 projeyi de paralı yapmayı düşünüyordum fakat vazgeçtimnsanları sömürme fikri hiç hoşuma gitmedi.Bu programları ÜLKEME adadım.Çünkü bu aralar üzerinde oynanan oyunlar hoşuma gitmiyor(Hiçbir zaman hoşuma gitmedi zaten)

 

Ama siz Trojan devri kapandı diince içime bir rahatsızlık düştü.Trojan projesini iptal etmeyi bile düşündüm(sizinle benzer fikirleri paylaşıyorum.3 seneye kalmaz bu işler sonlanır).Hatta Kaynak kodu bile yayınlamayı düşündüm.Umarım yazdıklarıma cevap gelir...

 

Diğer arkadaşlar da yorum getirebilirler bu konuya...

 

Herkese İyi Çalışmalar...

 

unreachableboy

 

mailto : unreachableboy@hotmail.com

 

........................................................

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

 

"

 

cevabım:

 

yazınızı okudum, düşüncelerinize paralel olarak şunları eklemek istiyorum,

 

trojan programlarını birbirleriyle kıyaslama yapmak istemiyorum, hepsinin kendisine göre

artıları ve eksileri vardır.

 

prorat konusuna değinmişsiniz, ki, prorat ile benim pek fazla bir alakam yok,

ancak, proratın yazarı atmaca ile yakın bir diyaloğum var,

 

dediğiniz gibi pluginler alıntı kod ile yapılmış, bu konuda tamamen haklısınız,

ve o alıntı kodların herkesce kullanılabilirliği apaçık ortada.

 

proratın eksiklikleri şu anki konumuz değil, bu konuya değinmişsiniz, ama gereği yoktu bence.

 

atmaca'nın takdir ettiğim yönü, proratın ilk versiyonundan itibaren,

c++ dilinde sıfırdan yazmış olması ve kendisini geliştirmiş olmasıdır.

 

son versiyonlarda kullandığı hazır pluginler onun kendi kişisel seçimidir.

 

"trojan devri bitti" derken şunu söylemek istedim,

 

dediğiniz gibi zamanında peşinden koşturduğumuz subsevenler ve türev programları hepimiz kullandık.

 

kullanım amacımız da, 145 bağlantı şifresi almak ve biraz da eğlenmek idi, bilirsiniz.

 

fw programları şu anda o kadar güçlendirildi ki, bunu siz de biliyorsunuz,

ayrıca adsl bağlantıları ve network ağ içi kullanımları da birhayli yaygınlaştığı için,

eskisi gibi trojan programı olarak ( socket server programı ) artık gizlilik özelliği kalmadı.

 

teknik olarak rootkit konusuna giriyor bu konu ki, bu da xp işletim sisteminin explorer

açığından kaynaklanıyor. bu yüzden de sürekli yama patch'ler çıkartılıyor.

 

rootkit kodların ortaya çıkmasıyla windows neredeyse dibe vurdu. çünkü güvenilir bir işletim

sistemi olmaktan ziyade, magazin ve tekel bir işletim sistemi durumunda zaten.

 

windowsun kendi hatasından kaynaklanan bir hata olarak görüyorum. ve günden güne de bu hataları

yan programları ( firewall programları ve rootkit process tarayıcı ve algılayıcıları )

trojan serverlarını öldürdüler.

 

söylemek istediğin buydu.

 

ne kadar sıfırdan trojan yazarsanız yazın, gizlenmesi son derece güç oldu artık.

 

bunu aşmanın da tek yöntemi şudur :

 

1. rootkit olarak kodlama yapacaksınız ( açılan portlardan dahi windowsun haberi olmuyor )

2. hafızadaki çalışan ana bir programın içine gömme ( embedded ) yapıp windowsu yanıltacaksınız,

ve dolaylı olarak fw programları da yanılıyorlar. ( defalarca irdeledim bunu )

3. hafızadaki ana bir programın bir alt programı olarak gösterebiliyor iseniz şayet, yine fw programlarını

geçme şansınız var ( irdelendi bu konu )

 

* eski yöntemlerde olduğu gibi fw programlarını "kill" etmek artık işe yaramıyor.

 

* her exe programını kill edemezsiniz. çalışan bazı exelerin türü "service" olarak geçtiği için.

 

* programınızın içinde "socket open" adı altında yazacağınız en ufak bir kodu dahi "kaspersky" antivirus

uyarı mesajında bulunuyor. ( deneyiniz )

 

bu yüzden "trojan devri öldü" demek istemiştim.

 

bunu legal ( kabul görmüş ) yazılım haline dönüştürürseniz,

bunun adı da herkesce kabul gören ve izin verilen bir "remote administrator" olacaktır.........

 

saygılarımla_

 

neoturk

 

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

 

neoturk - re: gerçekten trojan devri kapandi mi

unreachableboy demişsiniz ki:

 

"

........................................................

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

 

Sevgili neoturk.Kod Bankası kısmında bir kitapla ilgi görüşlerini okudum(tabiiki tamamını diil)...Orada sonlarda Trojanlarla ilgili bir kısım hakkında görüşlerini bildirmişsin(index konusuna katılıyorum).Daha sonra altına zaten trojan devri de kapandı tarzında not düşmüssün.Gerçekten de durum böyle mi?Yani Remote Admin Toollar tarihe mi karışıyor?Bir zamanlar herkesi peşinden koşturan Subsevenlar,Theefler,DeepThroatlar(ProRat diyemicem Çünkü ;

***

birçok hatalarla dolu ve şifreleri almakta kullandıkları pluginler kendilerine ait diil ve VB programlama diliyle yazılmış , command prompt ya da parametre kullanılarak çalıştırılan ve txt dosyasına kaydedilen bilgileri okuyan çalıntı ve ücretli bir RAT.Hataları saymakla bitiremem herhalde ama 1-2 tane söylim.

1-)Dosya Arama bölümünde bulunan dosyalar çok fazla ise Client tarafına eksik geliyor.Deneyin...

2-)Registry Editorde aynı şekilde.Current_Root bi girin.Deneyin...,

3-)File Manager çok uğraşılınca çöküyor...

 

nese fazla uzatmadan konuya dönimm:)

 

***efsaneleri bitiyor mu?Ben de Trojan ve Agent yazdım.

Trojan EditServer hariç hatasız çalışıyor ve ProRatin tüm özelliklerini taşıyor...Şaşırıyor olabilirsiniz.Ama 8 aydır gecemi gündüzüme kattım bunun için...

 

Agent ise tamamiyle bitti ve o da ProAgentın tüm özelliklerinin yanında esktra özellikleri de var.Kısa zamanda nete yaymayı düşünüyorum(tabii üniversiteden vakit bulursam:)

 

Bu 2 projeyi de paralı yapmayı düşünüyordum fakat vazgeçtimnsanları sömürme fikri hiç hoşuma gitmedi.Bu programları ÜLKEME adadım.Çünkü bu aralar üzerinde oynanan oyunlar hoşuma gitmiyor(Hiçbir zaman hoşuma gitmedi zaten)

 

Ama siz Trojan devri kapandı diince içime bir rahatsızlık düştü.Trojan projesini iptal etmeyi bile düşündüm(sizinle benzer fikirleri paylaşıyorum.3 seneye kalmaz bu işler sonlanır).Hatta Kaynak kodu bile yayınlamayı düşündüm.Umarım yazdıklarıma cevap gelir...

 

Diğer arkadaşlar da yorum getirebilirler bu konuya...

 

Herkese İyi Çalışmalar...

 

unreachableboy

 

mailto : unreachableboy@hotmail.com

 

........................................................

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

 

"

 

cevabım:

 

yazınızı okudum, düşüncelerinize paralel olarak şunları eklemek istiyorum,

 

trojan programlarını birbirleriyle kıyaslama yapmak istemiyorum, hepsinin kendisine göre

artıları ve eksileri vardır.

 

prorat konusuna değinmişsiniz, ki, prorat ile benim pek fazla bir alakam yok,

ancak, proratın yazarı atmaca ile yakın bir diyaloğum var,

 

dediğiniz gibi pluginler alıntı kod ile yapılmış, bu konuda tamamen haklısınız,

ve o alıntı kodların herkesce kullanılabilirliği apaçık ortada.

 

proratın eksiklikleri şu anki konumuz değil, bu konuya değinmişsiniz, ama gereği yoktu bence.

 

atmaca'nın takdir ettiğim yönü, proratın ilk versiyonundan itibaren,

c++ dilinde sıfırdan yazmış olması ve kendisini geliştirmiş olmasıdır.

 

son versiyonlarda kullandığı hazır pluginler onun kendi kişisel seçimidir.

 

"trojan devri bitti" derken şunu söylemek istedim,

 

dediğiniz gibi zamanında peşinden koşturduğumuz subsevenler ve türev programları hepimiz kullandık.

 

kullanım amacımız da, 145 bağlantı şifresi almak ve biraz da eğlenmek idi, bilirsiniz.

 

fw programları şu anda o kadar güçlendirildi ki, bunu siz de biliyorsunuz,

ayrıca adsl bağlantıları ve network ağ içi kullanımları da birhayli yaygınlaştığı için,

eskisi gibi trojan programı olarak ( socket server programı ) artık gizlilik özelliği kalmadı.

 

teknik olarak rootkit konusuna giriyor bu konu ki, bu da xp işletim sisteminin explorer

açığından kaynaklanıyor. bu yüzden de sürekli yama patch'ler çıkartılıyor.

 

rootkit kodların ortaya çıkmasıyla windows neredeyse dibe vurdu. çünkü güvenilir bir işletim

sistemi olmaktan ziyade, magazin ve tekel bir işletim sistemi durumunda zaten.

 

windowsun kendi hatasından kaynaklanan bir hata olarak görüyorum. ve günden güne de bu hataları

yan programları ( firewall programları ve rootkit process tarayıcı ve algılayıcıları )

trojan serverlarını öldürdüler.

 

söylemek istediğin buydu.

 

ne kadar sıfırdan trojan yazarsanız yazın, gizlenmesi son derece güç oldu artık.

 

bunu aşmanın da tek yöntemi şudur :

 

1. rootkit olarak kodlama yapacaksınız ( açılan portlardan dahi windowsun haberi olmuyor )

2. hafızadaki çalışan ana bir programın içine gömme ( embedded ) yapıp windowsu yanıltacaksınız,

ve dolaylı olarak fw programları da yanılıyorlar. ( defalarca irdeledim bunu )

3. hafızadaki ana bir programın bir alt programı olarak gösterebiliyor iseniz şayet, yine fw programlarını

geçme şansınız var ( irdelendi bu konu )

 

* eski yöntemlerde olduğu gibi fw programlarını "kill" etmek artık işe yaramıyor.

 

* her exe programını kill edemezsiniz. çalışan bazı exelerin türü "service" olarak geçtiği için.

 

* programınızın içinde "socket open" adı altında yazacağınız en ufak bir kodu dahi "kaspersky" antivirus

uyarı mesajında bulunuyor. ( deneyiniz )

 

bu yüzden "trojan devri öldü" demek istemiştim.

 

bunu legal ( kabul görmüş ) yazılım haline dönüştürürseniz,

bunun adı da herkesce kabul gören ve izin verilen bir "remote administrator" olacaktır.........

 

saygılarımla_

 

neoturk

 

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

 

neoturk - re: cevap neoturk edit1 içini temizleme

iskenderrr arkadaşım demişsiniz ki:

"

      çok uğraşdım ama yapamadım

     

      edit içine girilen metnin içeriğini button1 e tıkladığımda

      silmek istiyorum ????

 

      mail: xxxx@yyy.com

      neoturk

 

neoturk arkadaşımız burada soru soran herkes senin gibi uğraşsa ne ala kimileri

hiç uğraşmadan soruyor(!) sonra bazı .msda öğrencisi arkadaşlarımız da onları

öğrencileri gibi fırçalıyor :)

madem çok uğraştın al cevap

buttun1 in onclick olayına şunu yaz

edit1.text:='.msda';

bunu yazınca edit1'in içini temizlersin

kolay gelsin.

 

 

"

 

cevabım:

 

sanırım bir yanlış anlaşılma olmuş...

 

yazdığım kısa metrajlı sorular kasten ve nispet olarak sorulmuş sorular idi.

hepinizin bildiği gibi son derece "gıcık" edici soru tarzları değil mi sizce ?...

 

bu şekildeki soruların hem sorulmasına karşı olduğumu, hem de gereksiz sorulara karşı olduğumu,

vurgulamaya çalışmıştım.

 

ve bu soruları da siz sanıyorum ki benim sorduğumu düşünmüşsünüz....

 

hadi diyelim ki, sormuş dahi olsam, ne kadar laf kalabalığı yaptığımın da farkına varmışsınızdır...

 

bu denli sorulara kızdığımı vurgulamak istedim.

 

her önüne gelen, verdiğim örnekteki gibi sorularla burasını şişiriyorlar.

 

bunu anlatamıyorum sanırım ?....

 

saygılarımla_

 

neoturk

 

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

 

neoturk - re: cevap neoturk edit1 içini temizleme

iskenderrr arkadaşım demişsiniz ki:

"

      çok uğraşdım ama yapamadım

     

      edit içine girilen metnin içeriğini button1 e tıkladığımda

      silmek istiyorum ????

 

      mail: xxxx@yyy.com

      neoturk

 

neoturk arkadaşımız burada soru soran herkes senin gibi uğraşsa ne ala kimileri

hiç uğraşmadan soruyor(!) sonra bazı .msda öğrencisi arkadaşlarımız da onları

öğrencileri gibi fırçalıyor :)

madem çok uğraştın al cevap

buttun1 in onclick olayına şunu yaz

edit1.text:='.msda';

bunu yazınca edit1'in içini temizlersin

kolay gelsin.

 

 

"

 

cevabım:

 

sanırım bir yanlış anlaşılma olmuş...

 

yazdığım kısa metrajlı sorular kasten ve nispet olarak sorulmuş sorular idi.

hepinizin bildiği gibi son derece "gıcık" edici soru tarzları değil mi sizce ?...

 

bu şekildeki soruların hem sorulmasına karşı olduğumu, hem de gereksiz sorulara karşı olduğumu,

vurgulamaya çalışmıştım.

 

ve bu soruları da siz sanıyorum ki benim sorduğumu düşünmüşsünüz....

 

hadi diyelim ki, sormuş dahi olsam, ne kadar laf kalabalığı yaptığımın da farkına varmışsınızdır...

 

bu denli sorulara kızdığımı vurgulamak istedim.

 

her önüne gelen, verdiğim örnekteki gibi sorularla burasını şişiriyorlar.

 

bunu anlatamıyorum sanırım ?....

 

saygılarımla_

 

neoturk

 

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

 

neoturk - re: delphi bitti mi

yavuzyavuz arkadaşım, demişsiniz ki:

 

"

Kaldiki 4 yildir yuruttugum bir projede yerel kullanimda Delphi6 ve internet

uzerinde veri aktariminda kombineli olarak firebird (interbase) ve ASP yi

birlikte kusursuz ve hizli olarak kullabiliyorken niye .net zirvalariyla

ugrasayim?

"

 

cevabım:

 

bahsettiğiniz konu ile .net zirvaları arasında dağlar kadar fark var.

delphide rahat olarak internet üzerinde DCOM uygulamaları yazamazsınız.

 

DCOM un topolojisine göz atarsanız, söylediğiniz fikrin,

( interbase üzerinde asp uyumunun herhangi bir alakasını kuramadım kusura bakmayın )

 

interbase en etkin olarak "share pc" ler üzerinde etkindir. share pc lerin de

asp destekli kombine edilmesine uğraşmanız, DCOM un topolojisini içerir zaten,

ve bu konu da .net platformunda A'dan Z'ye kadar en ince ayrıntısına kadar

desteklendirilmiştir.

 

interbase veri tabanının kullanım amacı "share pc" ortamları gibi "network" ağlarında

verimlidir.

 

asp uygulamalarının bir kısmı da "share pc"-"network"-"webserver" sistemlerinde etkilidir.

 

"interbase" ve "asp" kavramlarını kombine etmeye çalışmanız,

DCOM'u kullanmadığınız anlamına gelir ki,

bu da yapmaya çalıştıklarınızın tamamının ".net" platformunun topolojisinde

bahsedildiğini görürsünüz, ve kulağınızı tersinden göstermekle eşdeğerdir.

 

google'den bu konu üzerine araştırma yapmanızı öneriyorum.

 

konu: DCOM + uygulama alanları + performans + .net

 

saygılarımla_

 

neoturk

 

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

 

neoturk - re: delphi bitti mi

yavuzyavuz arkadaşım, demişsiniz ki:

 

"

Kaldiki 4 yildir yuruttugum bir projede yerel kullanimda Delphi6 ve internet

uzerinde veri aktariminda kombineli olarak firebird (interbase) ve ASP yi

birlikte kusursuz ve hizli olarak kullabiliyorken niye .net zirvalariyla

ugrasayim?

"

 

cevabım:

 

bahsettiğiniz konu ile .net zirvaları arasında dağlar kadar fark var.

delphide rahat olarak internet üzerinde DCOM uygulamaları yazamazsınız.

 

DCOM un topolojisine göz atarsanız, söylediğiniz fikrin,

( interbase üzerinde asp uyumunun herhangi bir alakasını kuramadım kusura bakmayın )

 

interbase en etkin olarak "share pc" ler üzerinde etkindir. share pc lerin de

asp destekli kombine edilmesine uğraşmanız, DCOM un topolojisini içerir zaten,

ve bu konu da .net platformunda A'dan Z'ye kadar en ince ayrıntısına kadar

desteklendirilmiştir.

 

interbase veri tabanının kullanım amacı "share pc" ortamları gibi "network" ağlarında

verimlidir.

 

asp uygulamalarının bir kısmı da "share pc"-"network"-"webserver" sistemlerinde etkilidir.

 

"interbase" ve "asp" kavramlarını kombine etmeye çalışmanız,

DCOM'u kullanmadığınız anlamına gelir ki,

bu da yapmaya çalıştıklarınızın tamamının ".net" platformunun topolojisinde

bahsedildiğini görürsünüz, ve kulağınızı tersinden göstermekle eşdeğerdir.

 

google'den bu konu üzerine araştırma yapmanızı öneriyorum.

 

konu: DCOM + uygulama alanları + performans + .net

 

saygılarımla_

 

neoturk

 

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

 

Kodbank Sikayet Deposu  v0.1

(*******************************************************************

  Program: bir web sayfasını kendi varsayılan tarayıcısında açmak

  Amaç   : kodbankın kişisel tartışma alanına dönüşmesini engellemek

********************************************************************)

 

unit Unit1;

 

interface

 

uses

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

  Dialogs, ShellApi, StdCtrls;

 

type

  TForm1 = class(TForm)

    Button1: TButton;

    procedure Button1Click(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

 

implementation

 

{$R *.dfm}

 

procedure TForm1.Button1Click(Sender: TObject);

begin

ShellExecute(0,'open','http://d.1asphost.com/yeterbe/kodbank/default.asp','','',SW_SHOWMAXIMIZED);

end;

 

end.

 

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

 

Kodbank Sikayet Deposu  v0.1

(*******************************************************************

  Program: bir web sayfasını kendi varsayılan tarayıcısında açmak

  Amaç   : kodbankın kişisel tartışma alanına dönüşmesini engellemek

********************************************************************)

 

unit Unit1;

 

interface

 

uses

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

  Dialogs, ShellApi, StdCtrls;

 

type

  TForm1 = class(TForm)

    Button1: TButton;

    procedure Button1Click(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

 

implementation

 

{$R *.dfm}

 

procedure TForm1.Button1Click(Sender: TObject);

begin

ShellExecute(0,'open','http://d.1asphost.com/yeterbe/kodbank/default.asp','','',SW_SHOWMAXIMIZED);

end;

 

end.

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