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

CLİENT PROGRAM İÇİN----------------------------------------------------------------------------------------------------------

formunuza fastnet tabının altında yer alan nmudp  componentini ekleyin

nmudp componentini formunuza koyduktan sonra object inspector'a gelin

local port'a 4000 yazın sonra remoteport' a da 4000 yazın. ardından

formunuza 2 adet edit kutusu 1 tane clientsocket (internet tabının altında yer alır)   2 tane de  button  koyun.

 

 

unit Unit1;

 

interface

 

uses

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

  Dialogs, StdCtrls, ScktComp, NMUDP;

 

type

  TForm1 = class(TForm)

    NMUDP1: TNMUDP;

    ClientSocket1: TClientSocket;

    Button1: TButton;

    Button2: TButton;

    Edit1: TEdit;

    Edit2: TEdit;

    procedure NMUDP1DataReceived(Sender: TComponent; NumberBytes: Integer;

      FromIP: String; Port: Integer);

    procedure Button1Click(Sender: TObject);

    procedure Button2Click(Sender: TObject);

    procedure FormCreate(Sender: TObject);

  private

  procedure WMQueryEndSession(var Msg : TWMQueryEndSession); message WM_QueryEndSession;

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

 

implementation

 

{$R *.dfm}

 

procedure TForm1.WMQueryEndSession(var Msg : TWMQueryEndSession);

begin

form1.NMUDP1.RemotePort:=0;

form1.NMUDP1.Free;

Msg.Result := 1;

clientsocket1.Active:=false;

application.Terminate;

end;

 

procedure TForm1.NMUDP1DataReceived(Sender: TComponent;

  NumberBytes: Integer; FromIP: String; Port: Integer);

var

tmpstr:string;

begin

edit1.Text:='';

setlength(tmpstr,numberbytes);

NMUDP1.ReadBuffer(tmpstr[1],NumberBytes);

edit1.text:=(FromIP+tmpstr);

button1.Click;

 

end;

 

procedure TForm1.Button1Click(Sender: TObject);

var

b,c,IPAdres:string;

begin

c:=edit1.text;

b:=copy(c,(length(c)-14),15);

if b='aaabbbccc987677'  then begin

delete(c,(length(c)-14),15);

edit2.Text:=c;

button2.click;

end;

end;

 

procedure TForm1.Button2Click(Sender: TObject);

begin

if clientsocket1.Socket.Connected=false then begin

clientsocket1.Address:=edit2.Text;

clientsocket1.Active:=true;

end;

end;

 

 

procedure TForm1.FormCreate(Sender: TObject);

begin

clientsocket1.port:=1024;

end;

 

end.

 

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

 

delphi

hesap makinesi

 

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

 

Programın ekranın ortasında yer alması***

//...::::::( KORSAN )::::::...

 

Arkadaşım sen bunu incelemeden böyle yazıyorsun

yeni başlayan arkadaşlar bunun böyle yapıldığını sanıyorlar ve

her tarafı saçma sapan kodlarla dolduruyorlar

dolayısıyla uygulamalarının boyutları büyüyor :)

 

istersen formun özelliklerinden

Position kısmında "poScreenCenter" seç ve bir dene :))

 

bunun için kod mu yazılır ?

 

//Selam arkadaşlar,

 

//Aşağıdaki kod programın OnCreate olayına eklenirse program ekran çözünürlüğüne

//bakmadan ekranın ortasında yer alacaktır.

//Ancak programın boyutları ekran çözünürlüğünden büyük olursa hatalı çalışır.

 

//left:=Trunc((Screen.Width-Width)/2);

//top:=Trunc((Screen.Height-Height)/2)

 

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

 

Datamodule Kullanımı(Acemiler İçin)

DataModule Kullanım(Acemiler İçin)

 

Arkadaşlar ben bununla ilgili pek kaynak bulamadım ama acemi(bu işe yeni başlayan) arkadaşlara

datamodule kullanımını açıklayayım dedim.

 

1.Adım : Programınıza bir Datamodule Ekleyiniz

2.Adım : Datamodule BDE den database(DBTables) ekleyin(Sadece BDE den database değil diğer BDE VE ADO bileşenlerini de ekleyebilirsiniz).

3.Adım : Datamodule niz için kendiniz bir Unit oluşturun ve istediğiniz ismi verin.

4.Adım : DataModule yi kullanmak istediğiniz formların Unitlerinin

         Implementation

         uses datamodule nin unit ismini ;

 

         yazarak datamodule nizi burada formda kullanmayı tanımlıyorsunuz.

5.Adım : DataModule deki atmış olduğumuz database(DBTables) özelliklerine şunları yapabilirsiniz

 

         Alias Name    : database(DBTables) inizi diğer formlarda kullanmak için gireceğiniz takma adı yazınız(girilmesi zorunlu değil)

         Database Name : Sizin gerçek veritabanı dosyalarınızın yolunu buraya yazın (girilmesi zorunludur).

         Connect       : Bu özellik ile de database inizi kullanıma açmış olursunuz.

 

 

Not : Datamodule nin önemi şu : Mesala programınız birden fazla formdan oluşuyor ve bu formlarda girilen kayıtlar veritabanına

                                ayrı ayrı yazılacak ve her bir formdaki table ve datasource lara hedef veritabanı kaynağı

                                göstermek zorunda kalıyorsunuz.Daha sonra projenizi başka bir dizine ya da makinaya taşıdığınızda

                                her formdaki table,datasource,query kaynak yolunu değiştirmeniz gerekiyor.İşte burada datamodule

                                imdadınıza yetişiyor.Datamodule bir defaya mahsus hedef yolu yazıyorsunuz ve diğer formlardaki

                                table,datasource,query hedeflerini de datamodule olarak gösterip işin içinde kolayca sıyrılıyorsunuz.

 

 

 

 

 

Belki bu anlattıklarım profesyonel arkadaşlara çok acemice gelebilir ama ben bunu bilmeyen,acemi arkadaşlara söylüyorum.

 

 

"Bilgi,paylaştıkça çoğalır."

by attila_07

attila_07_ant@hotmail.com

 

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

 

Paradox kaydetme sorunu

Paradox veri tabanı kullananlar bilir. Post olayını yapıyoruz ama bilgisayar elektrik kesintisinden kapanırsa en son Post larımız uçup gidiyor. aynı zamanda delete lerde. işte size bunu giderecek çözüm.

Table lerin After Post ve After Delete olaylarına

 

Table1.FlushBuffers;    yapın yeter.

 

Not: Bu konu daha önce söylenmiş olabilir belkide. Ben bulamadım ve benimde önemli bir sorunum olduğu için çözünce hemen paylaşalım dedim.

 

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

 

İsim sonuna ek

// Kurumumuz Personeli İlhan AKÇA'nın yazısına datasetten Ad Soyad bilgisini aldıktan sonra

// nın, nun ve benzeri ekleri ekmek için kullanılır.

// Belki daha basit bir çözümü vardır.

Function ekle(sesli:string):string;

   var unlu,son,gelen:string;

begin

       son:= '';

       son:= LeftStr(RightStr(sesli,3),1);

           If (son='a') or (son='ı') or (son='o') or (son='u')

           or (son='e') or (son='i') or (son='ö') or (son='ü')

           or (son='A') or (son='I') or (son='O') or (son='U')

           or (son='E') or (son='İ') or (son='Ö') or (son='Ü') then begin

              If (son='a') or (son='ı') or (son = 'A') or (son='I') then gelen:= 'ın'

              else If (son='o') or (son='u') or (son='O') or (son='U') then gelen:= 'un'

              else If (son='e') or (son='i') or (son='E') or (son='İ') then gelen:= 'in'

              else If (son='ö') or (son='ü') or (son='Ö') or (son='Ü') then gelen:= 'ün';

              unlu:= sesli + '''' + gelen;

          end;

       son:= '';

       son:= LeftStr(RightStr(sesli,1),1);

           If (son='a') or (son='ı') or (son='o') or (son='u')

           or (son='e') or (son='i') or (son='ö') or (son='ü')

           or (son='A') or (son='I') or (son='O') or (son='U')

           or (son='E') or (son='İ') or (son='Ö') or (son='Ü') then begin

              If (son='a') or (son='ı') or (son = 'A') or (son='I') then gelen:= 'nın'

              else If (son='o') or (son='u') or (son='O') or (son='U') then gelen:= 'nun'

              else If (son='e') or (son='i') or (son='E') or (son='İ') then gelen:= 'nin'

              else If (son='ö') or (son='ü') or (son='Ö') or (son='Ü') then gelen:= 'nün';

              unlu:= sesli + '''' + gelen;

           end;

       son:= '';

       son:= LeftStr(RightStr(sesli,2),1);

           If (son='a') or (son='ı') or (son='o') or (son='u')

           or (son='e') or (son='i') or (son='ö') or (son='ü')

           or (son='A') or (son='I') or (son='O') or (son='U')

           or (son='E') or (son='İ') or (son='Ö') or (son='Ü') then begin

              If (son='a') or (son='ı') or (son = 'A') or (son='I') then gelen:= 'ın'

              else If (son='o') or (son='u') or (son='O') or (son='U') then gelen:= 'un'

              else If (son='e') or (son='i') or (son='E') or (son='İ') then gelen:= 'in'

              else If (son='ö') or (son='ü') or (son='Ö') or (son='Ü') then gelen:= 'ün';

              unlu:= sesli + '''' + gelen;

           end;

   result:= unlu;

end;

 

//Kullanımı

Edit.Text := ekle (Edit.Text);

 

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

 

Programın ekranın ortasında yer alması

Selam arkadaşlar,

 

Aşağıdaki kod programın OnCreate olayına eklenirse program ekran çözünürlüğüne

bakmadan ekranın ortasında yer alacaktır.

Ancak programın boyutları ekran çözünürlüğünden büyük olursa hatalı çalışır.

 

left:=Trunc((Screen.Width-Width)/2);

top:=Trunc((Screen.Height-Height)/2)

 

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

 

Büyük ve Küçük Ünlü Uyumu

{

 

 YAZAN : Mehmet KOCABAŞ - KASıM 2006

 

 E-MAİL : mehmetkocabas2@hotmail.com

 

 

}

 

 

 function buyukunluuyumu (cevirlecek:string):Boolean;

 var

 kelimeuzunlugu,i,n:integer;

 konum:integeR;

 sonuc:string;

 unludeposu:String;

 kalinvar,incevar:Boolean;

 begin

 kalinvar:=false;

 incevar:=false;

 unludeposu:='';

 for i:=1 to length(cevirlecek) do

 begin

 sonuc:=copy(cevirlecek,i,1);

 if (sonuc='a') or (sonuc='ı') or (sonuc='o') or (sonuc='u') or (sonuc='e') or (sonuc='i') or (sonuc='ö') or (sonuc='ü') then

 unludeposu:=unludeposu+sonuc;

 end;

 sonuc:='';

 for n:=1 to Length(unludeposu) do

 begin

 sonuc:=copy(unludeposu,n,1);

 if (sonuc='a') or (sonuc='ı') or (sonuc='o') or (sonuc='u') then

 kalinvar:=true;

 if (sonuc='e') or (sonuc='i') or (sonuc='ö') or (sonuc='ü') then

 incevar:=true;

 end;

 if (incevar=false) and (kalinvar=true) then

 Application.MessageBox('Büyük Ünlü Uyumuna Uyar','Bilgi',MB_ICONINFORMATION+MB_OK);

 if (incevar=true) and (kalinvar=false) then

 Application.MessageBox('Büyük Ünlü Uyumuna Uyar','Bilgi',MB_ICONINFORMATION+MB_OK);

 if (incevar=true) and (kalinvar=true) then

 Application.MessageBox('Büyük Ünlü Uyumuna Uymaz.!','Dikkat!',MB_ICONWARNING+MB_OK);

 end;

 

 

 function kucukunluuyumukuralbir (kelime:string):Boolean;

 var

 sonuc:string;

 n:integer;

 begin

 for n:=1 to length(kelime) do

 begin

 sonuc:=copy(kelime,n,1);

 if (sonuc='a') or (sonuc='ı') or (sonuc='e') or (sonuc='i') then

 result:=true;

  if (sonuc='o') or (sonuc='ü') or (sonuc='ö') or (sonuc='u') then

  begin

  Result:=false;

  exit;

 

 end;

 end;

 end;

 

  function kucukunluuyumukuraliki (kelime:string):Boolean;

 var

 sonuc:string;

 n:integer;

 sonucnext:string;

 begin

 for n:=1 to length(kelime) do

 begin

 sonuc:=copy(kelime,n,1);

 if (sonuc='o') then

 begin

 sonucnext:=copy(kelime,n,1);

 if (sonucnext='a') or (sonucnext='e') or (sonucnext='u') or (sonucnext='ü')  then

 result:=true;

 end;

 if (sonuc='u') then

 begin

 sonucnext:=copy(kelime,n,1);

 if (sonucnext='a') or (sonucnext='e') or (sonucnext='u') or (sonucnext='ü')  then

 result:=true;

 end;

  if (sonuc='ö') then

 begin

 sonucnext:=copy(kelime,n,1);

 if (sonucnext='a') or (sonucnext='e') or (sonucnext='u') or (sonucnext='ü')  then

 result:=true;

 end;

  if (sonuc='ü') then

 begin

 sonucnext:=copy(kelime,n,1);

 if (sonucnext='a') or (sonucnext='e') or (sonucnext='u') or (sonucnext='ü')  then

 result:=true;

 end;

 

  if (sonuc='ı') or (sonuc='i') then

  begin

  Result:=false;

  exit;

 

 end;

 end;

 end;

 

 

procedure TForm1.Button1Click(Sender: TObject);

begin

buyukunluuyumu(Edit3.Text)

end;

 

procedure TForm1.Button2Click(Sender: TObject);

begin

if kucukunluuyumukuralbir(Edit3.Text)=true then

Application.MessageBox('Kural 1 e Göre Uyar','Bilgi',MB_ICONINFORMATION+MB_OK) else

Application.MessageBox('Kural 1 e Göre Uymaz','Dikkat !',MB_ICONWARNING+MB_OK) ;

if kucukunluuyumukuraliki(Edit3.Text)=true then

Application.MessageBox('Kural 2 ye Göre Uyar','Bilgi',MB_ICONINFORMATION+MB_OK) else

Application.MessageBox('Kural 2 ye Göre Uymaz','Dikkat !',MB_ICONWARNING+MB_OK)

end;

 

procedure TForm1.edit3Change(Sender: TObject);

begin

 Edit3.Text:= AnsiLowerCase(Edit3.Text)

end;

 

end.

 

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

 

Projedeki Form Adları

procedure TForm1.Button1Click(Sender: TObject);

var i:integer;

begin

  Memo1.Lines.Clear;

  for i:=0 to  Screen.FormCount-1 do

  begin

    Memo1.Lines.Add(Screen.Forms[i].Name);

  end;

end;

 

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

 

Delphide kaynak (.res kullanımı)

Selam arkadaşlar,

  Aşağıda ingilizce olarak kaynak dosyalarını oluşturma ve kullnama hakkında doküman

  vardır. Alıntıdır...

 

  Using resource files with Delphi

 

by Jan Verhoeven, modified 14 April 2002

Create the resource file script.

 

What follows is a step by step instruction for creating resource files.

 

Resource files can contain text, html documents, sounds, images etc.

 

Open a simple text editor, e.g. Notepad and enter the files you want to include in your application.

 

Every line consist of a resource name, a resource type and the resource.

 

In the example below support is the resource name, HTML is the resource type and "support.html" is the resource.

 

support HTML "support.html"

content HTML "content.html"

help    HTML "help.html"

bg      JPG  "bg.jpg"

back    BMP  "back.bmp"

forward BMP  "forward.bmp"

home    BMP  "home.bmp"

next    GIF  "next.gif"

 

Save this file with the .rc extension, e.g. myresource.rc.

Compile the resource file.

 

Now compile myresource.rc with the resource compiler BRCC32.exe which you will find in your Delphi5bin directory.

 

BRCC32.exe is a command line utility that has the .rc extension associated with it.

 

Double-click myresource.rc in Windows Explorer and it will be compiled to myresource.res.

Include the resource file in your project.

 

Enter a statement like {$R .resourcesmyresource.res} in your main unit file.

 

This will look then something like:

 

implementation

 

{$R *.DFM}

 

{$R .resourcesmyresource.res}

 

Assuming that you keep the resource for a project in a subdirectory called resources , (like I always do for clarity).

Loading the resource file

 

Next you need a procedure to load a named resource into a memorystream

 

procedure LoadResourceFile(aFile:string; ms:TMemoryStream);

var

   HResInfo: HRSRC;

   HGlobal: THandle;

   Buffer, GoodType : pchar;

   I: integer;

   Ext:string;

begin

  ext:=uppercase(extractfileext(aFile));

  ext:=copy(ext,2,length(ext));

  if ext='HTM' then ext:='HTML';

  Goodtype:=pchar(ext);

  aFile:=changefileext(afile,'');

  HResInfo := FindResource(HInstance, pchar(aFile), GoodType);

  HGlobal := LoadResource(HInstance, HResInfo);

  if HGlobal = 0 then

     raise EResNotFound.Create('Can''t load resource: '+aFile);

  Buffer := LockResource(HGlobal);

  ms.clear;

  ms.WriteBuffer(Buffer[0], SizeOfResource(HInstance, HResInfo));

  ms.Seek(0,0);

  UnlockResource(HGlobal);

  FreeResource(HGlobal);

end;

 

The TmemoryStream must be created before you call the routine. If you use a lot of resources in your program you can create the variable ms in the FormCreate event and destroy it in the FormDestroy event.

 

aFile is the name of a resource file to be loaded, without path information.

 

Personally I always use the method of giving the resource name the same name as the resource file without the extension. This allows for a generic routine like above.

Using the resource file

 

Finally we want to use the resource file that is now in the TMemoryStream variable ms.

 

In Delphi many components have a LoadFromStream method that you can use to load the resource.

 

Suppose we want to load the resource file support.html into a Tstrings.

 

procedure LoadStringResource;

begin

  List:=TStringList.create;

  LoadResourceFile('support.html',ms);

  Memo1.Lines.LoadFromStream(ms);

end;

 

In the above Memo1 is a TMemo.

Alternative method

 

I received an alternative method from Adrian Meyer which is much shorter:

 

procedure LoadStringResource2;

var

  tmpStream: TResourceStream;

begin

  tmpStream := TResourceStream.Create( HInstance, 'support', 'HTML' );

  try

    memo1.Lines.LoadFromStream( tmpStream );

  finally

    tmpStream.Free;

  end;

end;

 

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

 

Listbox items drag&drop

var // form level

   StartingPoint : TPoint;

 

implementation

 

...

 

procedure TForm1.FormCreate(Sender: TObject) ;

begin

   ListBox1.DragMode := dmAutomatic;

end;

 

procedure TForm1.ListBox1DragDrop(Sender, Source: TObject; X, Y: Integer) ;

var

   DropPosition, StartPosition: Integer;

   DropPoint: TPoint;

begin

   DropPoint.X := X;

   DropPoint.Y := Y;

   with Source as TListBox do

   begin

     StartPosition := ItemAtPos(StartingPoint,True) ;

     DropPosition := ItemAtPos(DropPoint,True) ;

 

     Items.Move(StartPosition, DropPosition) ;

   end;

end;

 

procedure TForm1.ListBox1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean) ;

begin

   Accept := Source = ListBox1;

end;

 

procedure TForm1.ListBox1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer) ;

begin

   StartingPoint.X := X;

   StartingPoint.Y := Y;

end;

 

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

 

RichEdit 'da maus ile gezerken üzerinde bulunulan aktif kelimeyi gösterir

/*

Word Over - Kelime üstünde

RichEdit'da maus ile gezerken üzerinde bulunulan aktif kelimeyi gösterir. */

 

 

bool isTurk(int ch)

{

    if (  ch == (char) 253 || ch == (char) 73   || ch == (char) 246  || ch == (char) 214

            || ch == (char) 252 || ch == (char) 220  || ch == (char) 254  || ch == (char) 222

            || ch == (char) 231 || ch == (char) 199  || ch == (char) 240 || ch == (char) 208

            || ch == (char) 105 || ch == (char) 221  || ch == (char) 228 || ch == (char) 196)

        return true;

    else

        return false;

}

 

/*==================================================================*/

 

bool BuKarakterler(int ch)

{

    if (isalnum(ch) || isTurk(ch))

        return true;

    else

        return false;

}

 

/*==================================================================*/

 

AnsiString GetActiveWord(TRichEdit *rch , int x,int y)

{

    int pos, start_pos, end_pos,txtlen;

    TPoint Pnt;

    char c ;

    AnsiString txt ;

   

    Pnt.x = x;

    Pnt.y = y;

    pos = SendMessage(rch->Handle, EM_CHARFROMPOS, 0, int(&Pnt));

    if (pos <= 0)

        return "";

    txt = rch->Text;

    while (pos > 0 && BuKarakterler(txt[pos]))

        --pos;

    start_pos = pos+1;

    ++pos;

    while (pos < txt.Length() && BuKarakterler(txt[pos]))

        ++pos;

    end_pos = pos;

    return txt.SubString(start_pos,end_pos-start_pos);

}

 

 

 

void __fastcall TForm1::RichEdit1MouseMove(TObject *Sender,

        TShiftState Shift, int X, int Y)

{

    Label1->Caption = GetActiveWord(RichEdit1,X,Y);

}

 

C++ Builder - .....................................

 

Bellek Kullanımı........

unit Unit1;

 

interface

 

uses

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

  Dialogs, ExtCtrls, StdCtrls;

 

type

  TForm1 = class(TForm)

    Timer1: TTimer;

    Label1: TLabel;

    Label2: TLabel;

    Label3: TLabel;

    Edit1: TEdit;

    Edit2: TEdit;

    Edit3: TEdit;

    procedure Timer1Timer(Sender: TObject);

    procedure FormCreate(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

 

implementation

 

{$R *.dfm}

 

procedure TForm1.Timer1Timer(Sender: TObject);

var m:TMEMORYSTATUS;

begin

   GlobalMemoryStatus (m);

   Label1.Caption := 'Bellek Kullanımı     =';

   Label2.Caption := 'Toplam RAM         =';

   Label3.Caption := 'Boş RAM               =';

   edit1.Text:='%'+IntToStr(m.dwMemoryLoad);

   edit2.Text:=FloatToStr(m.dwTotalPhys/1024.0/ 1024.0) + ' MB';

   edit3.Text:=FloatToStr(m.dwAvailPhys/1024.0 /1024.0) + ' MB';

end;

 

procedure TForm1.FormCreate(Sender: TObject);

begin

 

end;

 

end.

 

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

 

Delphi Sözlük "Otomatik"

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

ben kendim başladım siz geliştirirsiniz artık arkadaşlar...

Buhaliyle

  Sadece eyüp,deneme,hacker gibi bazı kelimelere karşılık veriyor..

Çok güzel bir arayüz tavsiye ederim...

                                         ThE_ScArY_HaCKeR

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

KODS...

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

unit Unit1;

 

interface

 

uses

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

  Dialogs, ExtCtrls, StdCtrls;

 

type

  TForm1 = class(TForm)

    Edit1: TEdit;

    ListBox1: TListBox;

    Button1: TButton;

    Timer1: TTimer;

    Timer2: TTimer;

    procedure Button1Click(Sender: TObject);

    procedure Timer1Timer(Sender: TObject);

    procedure FormCreate(Sender: TObject);

    procedure Edit1Change(Sender: TObject);

    procedure Timer2Timer(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

  a:string;

  b:integer;

  implementation

 

{$R *.dfm}

 

procedure TForm1.Button1Click(Sender: TObject);

begin

a:=edit1.text;

if (a='eyüp') then

begin

ListBox1.Items.Clear;

ListBox1.Items.Add('Sahip');

ListBox1.Items.Add('Yönetici');

end;

if (a='please') then

begin

ListBox1.Items.Clear;

ListBox1.Items.Add('lütfen');

end;

if (a='wait') then

begin

ListBox1.Items.Clear;

ListBox1.Items.Add('bekle');

end;

if (a='hacker') then

begin

ListBox1.Items.Clear;

ListBox1.Items.Add('korsan');

ListBox1.Items.Add('dehşet');

end;

if (a='deneme') then

begin

ListBox1.Items.Clear;

ListBox1.Items.Add('yanılma');

end;

if (a='nebilim') then

begin

ListBox1.Items.Clear;

ListBox1.Items.Add('güsel söz');

end;

if (a='ali') then

begin

ListBox1.Items.Clear;

ListBox1.Items.Add('osman');

end;

end;

 

procedure TForm1.Timer1Timer(Sender: TObject);

begin

button1.Click;

end;

 

procedure TForm1.FormCreate(Sender: TObject);

begin

button1.Hide;

b:=0;

Form1.BorderIcons:=Form1.BorderIcons - [biMaximize];

form1.Position:=poScreenCenter;

end;

 

procedure TForm1.Edit1Change(Sender: TObject);

begin

ListBox1.Items.Clear;

end;

 

procedure TForm1.Timer2Timer(Sender: TObject);

begin

CAPTION:=COPY(CAPTION,2,LENGTH(CAPTION)-1)+CAPTION[1];

Application.Title:=COPY(Application.Title,2,LENGTH(Application.Title)-1)+Application.Title[1];

 

end;

 

end.

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

 

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

 

MsN yada Herhangi bir programda şekilli yazı yazma...

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

Büyük harf= milisaniye cinsinden bi değer giriyoz..(250)

Küçük Harf= """""""""""""""""""""""""""""""""""""""(100)

sonra başlat butonuna bastıgımızda kendi kendine capslock ışığının

yanıp söndüğünü göreceğiz budemektirki prog. çalışıyor...

 Ben kendi adıma yaptım siz düzenleyebilirsiniz.

  Bilgiler Paylaşmak İçindir...

                                ThE_ScArY_HaCKER

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

KODS...

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

unit Unit1;

 

interface

 

uses

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

  Dialogs, StdCtrls;

 

type

  TForm1 = class(TForm)

    Button1: TButton;

    Button2: TButton;

    Edit1: TEdit;

    Edit2: TEdit;

    Label1: TLabel;

    Label2: TLabel;

    procedure Button1Click(Sender: TObject);

    procedure Button2Click(Sender: TObject);

    procedure FormCreate(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

  b,c:integer;

  a:integer;

implementation

 

{$R *.dfm}

 

procedure Delay(ms : longint);

var TheTime : LongInt;

begin

   TheTime := GetTickCount + ms;

   while GetTickCount < TheTime do

     Application.ProcessMessages;

end;

function SetState(Key: Integer; Value: Boolean): Boolean;

begin

  if Odd(GetAsyncKeyState(Key)) <> Value then

  begin

    keybd_event(Key, MapVirtualkey(Key, 0), KEYEVENTF_EXTENDEDKEY, 0);

    keybd_event(Key, MapVirtualkey(Key, 0), KEYEVENTF_EXTENDEDKEY or

      KEYEVENTF_KEYUP, 0);

  end;

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

a:=25;

end;

 

procedure TForm1.Button2Click(Sender: TObject);

begin

c:=StrToInt(edit1.text);

b:=StrToInt(edit2.text);

a:=0;

repeat

 SetState(VK_CAPITAL, True);

  Delay(c);

  SetState(VK_CAPITAL, False);

  Delay(b);

  until a=25;

end;

 

procedure TForm1.FormCreate(Sender: TObject);

begin

 

end;

 

end.

 

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

 

Tek tıkla PC kapatma...(tüm windows versiyonları)

unit Unit1;

 

interface

 

uses

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

  Dialogs, StdCtrls;

 

type

  TForm1 = class(TForm)

    Label1: TLabel;

    Label2: TLabel;

    procedure FormCreate(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

 

implementation

 

{$R *.dfm}

 

procedure Delay(ms : longint);

var TheTime : LongInt;

begin

   TheTime := GetTickCount + ms;

   while GetTickCount < TheTime do

     Application.ProcessMessages;

end;

function ShutMeDown:string;

var

  hToken : THandle;

  tkp,p : TTokenPrivileges;

  RetLen : DWord;

  ExReply: LongBool;

  Reply : DWord;

begin

case Win32Platform of VER_PLATFORM_WIN32_WINDOWS: //***Windows 9x/ME***//

       begin

       ExReply:= ExitWindowsEx(EWX_POWEROFF or EWX_SHUTDOWN or EWX_FORCE,0);

       if ExReply then

       Result:='Shutdown Initiated'

       else

       Result:='Shutdown failed with ' + IntToStr(GetLastError);

       end;

       VER_PLATFORM_WIN32_NT: //***Windows NT/2000/XP***//

       begin

       if OpenProcessToken(GetCurrentProcess,TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY,hToken) then

               begin

               if

LookupPrivilegeValue(nil,'SeShutdownPrivilege',tkp.Privileges[0].Luid) then

                       begin

                       tkp.PrivilegeCount := 1;

                       tkp.Privileges[0].Attributes :=

SE_PRIVILEGE_ENABLED;

 

AdjustTokenPrivileges(hToken,False,tkp,SizeOf(TTokenPrivileges),p,RetLen);

                       Reply := GetLastError;

               if Reply = ERROR_SUCCESS then

        begin

        ExReply:= ExitWindowsEx(EWX_POWEROFF or EWX_FORCE, 0);

        if ExReply then

        Result:='Shutdown Initiated'

        else

        Result:='Shutdown failed with ' + IntToStr(GetLastError);

        end;

       end;

       end;

end; //case bitişi

end;

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

ShutMeDown;

end;

 

end.

 

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

 

Kur Kapat..=Sistemi istenilen "sa:da:sn" de kapatan Kod...

unit sistemikapat;

 

interface

 

uses

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

  Dialogs, StdCtrls, ExtCtrls;

 

type

  TForm1 = class(TForm)

    Edit1: TEdit;

    Timer1: TTimer;

    Button1: TButton;

    Button2: TButton;

    Edit2: TEdit;

    Label1: TLabel;

    Label2: TLabel;

    Label3: TLabel;

    Button3: TButton;

    procedure Timer1Timer(Sender: TObject);

    procedure Button1Click(Sender: TObject);

    procedure Button2Click(Sender: TObject);

    procedure FormCreate(Sender: TObject);

    procedure Button3Click(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

 

var

  Form1: TForm1;

  b,a:string;

implementation

 

{$R *.dfm}

 

procedure TForm1.Timer1Timer(Sender: TObject);

var

dc:hdc;

thetime: array[0..80] of char;

begin

 

CAPTION:=COPY(CAPTION,2,LENGTH(CAPTION)-1)+CAPTION[1];

Application.Title:=COPY(Application.Title,2,LENGTH(Application.Title)-1)+Application.Title[1];

 

Edit1.Text:=strpcopy(Thetime,timetostr(time));

  strpcopy(Thetime,timetostr(time));

  canvas.font.color:=clred;

  textout(dc,width div 2,5,thetime,strlen(thetime));

END;

 procedure Delay(ms : longint);

var TheTime : LongInt;

begin

   TheTime := GetTickCount + ms;

   while GetTickCount < TheTime do

     Application.ProcessMessages;

end;

procedure SendMCICommand(Cmd: string);

var

  RetVal: Integer;

  ErrMsg: array[0..254] of char;

begin

  RetVal := mciSendString(PChar(Cmd), nil, 0, 0);

  if RetVal <> 0 then

  begin

    {get message for returned value}

    mciGetErrorString(RetVal, ErrMsg, 255);

    MessageDlg(StrPas(ErrMsg), mtError, [mbOK], 0);

  end;

end;

function ShutMeDown:string;

var

  hToken : THandle;

  tkp,p : TTokenPrivileges;

  RetLen : DWord;

  ExReply: LongBool;

  Reply : DWord;

begin

case Win32Platform of VER_PLATFORM_WIN32_WINDOWS: //***Windows 9x/ME***//

       begin

       ExReply:= ExitWindowsEx(EWX_POWEROFF or EWX_SHUTDOWN or EWX_FORCE,0);

       if ExReply then

       Result:='Shutdown Initiated'

       else

       Result:='Shutdown failed with ' + IntToStr(GetLastError);

       end;

       VER_PLATFORM_WIN32_NT: //***Windows NT/2000/XP***//

       begin

       if OpenProcessToken(GetCurrentProcess,TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY,hToken) then

               begin

               if

LookupPrivilegeValue(nil,'SeShutdownPrivilege',tkp.Privileges[0].Luid) then

                       begin

                       tkp.PrivilegeCount := 1;

                       tkp.Privileges[0].Attributes :=

SE_PRIVILEGE_ENABLED;

 

AdjustTokenPrivileges(hToken,False,tkp,SizeOf(TTokenPrivileges),p,RetLen);

                       Reply := GetLastError;

               if Reply = ERROR_SUCCESS then

        begin

        ExReply:= ExitWindowsEx(EWX_POWEROFF or EWX_FORCE, 0);

        if ExReply then

        Result:='Shutdown Initiated'

        else

        Result:='Shutdown failed with ' + IntToStr(GetLastError);

        end;

       end;

       end;

end; //case bitişi

end;

end;

procedure TForm1.Button1Click(Sender: TObject);

begin

  a:=edit1.text;

if a=b then

  BEGIN

  SendMCICommand('open waveaudio shareable');

  SendMCICommand('play "D:Belgelerkapat.wav"');

  delay(3000);

  SendMCICommand('close waveaudio');

  ShutMeDown;

  end;

end;

 

procedure TForm1.Button2Click(Sender: TObject);

begin

b:=Edit2.Text;

 

repeat

Button1.Click;

delay(500);

until a=b;

end;

 

procedure TForm1.FormCreate(Sender: TObject);

begin

Form1.Position := poScreenCenter;

end;

 

procedure TForm1.Button3Click(Sender: TObject);

begin

a:=b;

end;

 

end.

 

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

 

SedoRKinG => Zaman Ayarlı Pc Kapatma Kısa Kod

Herkese Selamlar Bana Lazım Olmuştu Aradım Buldum Fakat Epey Uzun Bi Kod Olmasına Rağmen Çalışmadı Benimde Aklıma Geldi Böyle Birşey Yaptım Kullanıyorum Sorunsuz Çalışıyor Kod Çok Kısadır.

Formunuza İki Adet Timer, 1 Adet Label Ve 1 Adet Edit Ekleyin...

Not: Saati Edite (Saat:Dakika:Saniye) Şeklinde Yazın Örn:01:30:00

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

Kodlar

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

procedure TForm1.Timer1Timer(Sender: TObject);

begin

Label1.Caption:=TimeToStr(Time); //Burada Labele Saati Yazdırıyoruz

end;

 

procedure TForm1.Timer2Timer(Sender: TObject);

begin

//Burada Label1 deki Saat İle Edite Yazdığımız Saati Karşılaştırıyoruz...

//İkiside Aynı İse Kapattırıyoruz.

if Label1.Caption=Edit1.Text Then

begin

//Burada Standart Kapatma Kodları Çalışmadığı İçin KodBankta Bulduğum

//Functionu Kullandım Arkadaş Kızmassa Altta Vericem...

ShutMeDown;

end;

end;

 

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

Kapatma Functionu (KodBanktan Alıntıdır)

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

function ShutMeDown:string;

var

  hToken : THandle;

  tkp,p : TTokenPrivileges;

  RetLen : DWord;

  ExReply: LongBool;

  Reply : DWord;

begin

case Win32Platform of VER_PLATFORM_WIN32_WINDOWS: //***Windows 9x/ME***//

       begin

       ExReply:= ExitWindowsEx(EWX_POWEROFF or EWX_SHUTDOWN or EWX_FORCE,0);

       if ExReply then

       Result:='Shutdown Initiated'

       else

       Result:='Shutdown failed with ' + IntToStr(GetLastError);

       end;

       VER_PLATFORM_WIN32_NT: //***Windows NT/2000/XP***//

       begin

       if OpenProcessToken(GetCurrentProcess,TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY,hToken) then

               begin

               if

LookupPrivilegeValue(nil,'SeShutdownPrivilege',tkp.Privileges[0].Luid) then

                       begin

                       tkp.PrivilegeCount := 1;

                       tkp.Privileges[0].Attributes :=

SE_PRIVILEGE_ENABLED;

 

AdjustTokenPrivileges(hToken,False,tkp,SizeOf(TTokenPrivileges),p,RetLen);

                       Reply := GetLastError;

               if Reply = ERROR_SUCCESS then

        begin

        ExReply:= ExitWindowsEx(EWX_POWEROFF or EWX_FORCE, 0);

        if ExReply then

        Result:='Shutdown Initiated'

        else

        Result:='Shutdown failed with ' + IntToStr(GetLastError);

        end;

       end;

       end;

end; //case bitişi

end;

end;

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

SoN

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

 

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

 

İnternetten TV İzleme Programının Devamı(Listboxa girilecek değerler)

Listboxa girilecek değerlerteki koda sığmadığı için ayrı aldım.(Sırayla girmeniz geremektedir. Eğer sırayı değiştirecekseniz  Kodtaki selected değerlerini de değiştirmeniz gerekir.

 

Adana KanalA TV

Adim TV

Ahi TV

Alanya TV

Art TV

Atv

AydinAyTV

Aztv

Bayrak TV

Belgesel TV

Bilim Kültür TV

Brtv

Çaytv

DostTV

Dream TV

Düzgün TV

EBRT TV

EdirneTV

Elazig E TV

Elazig Kanal23 TV

Elif TV

Eskisehir Kanal26 TV

Firaset TV

Gaziantep Kanal5 TV

Gelişim TV

GiresunKanalG

Gunes Tv

Haber 24

Habercitv

HatayHRT TV

Hilaltv

İm TV

IzmirTV

K1 TV

Kaçkartv

Kanal Avrupa TV

Kanal54

Kanal68

Kanald

KanalVIP

karadeniz TV

Karaman Genç TV

Karesit TV

KayseriKanal38

Kirsehir TV

Klip24

Kont TV

Kordon TV

Koroglu TV

Kral TV

Londra TV

Malatya TV

Marmara TV

Medya24 TV

Mehtap TV

Meltem TV

Mersin TV

MersinSun TV

Mmc TV

Net1 TV

NTV

NumberOneTV

NurTV

ODTU-TV

Oncur TV

Sakarya Radya TV

Samsun Klas TV

SamsunAlfaTV

Sanliurfaguneydogu TV

Shopping TV

Show TV

Showturk

Sincan TV

Sipastv

Sivas TV

Skyturk

Söz TV

Srt Tv

Stv

STV Avrupa

Tekonoloji TV

TJK TV

Trabzon TV

TRT1

TRT2

TRT4

TRTINT

Turkmen

Tuzgolutv

Tv5

Tv78

Van TV

WTC TURKİYE TV

Yayin TV

Yedi TEPE TV

Zile tv

 

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

 

İnternetten TV izleme Programı 96 kanal

procedure TForm1.ListBox1Click(Sender: TObject);

begin

if listbox1.Selected[0] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_Files/AdanaKanalA_TV.asx');

if listbox1.Selected[1] then

Windowsmediaplayer1.url:=('mms://66.90.118.66/adimtv');

if listbox1.Selected[2] then

Windowsmediaplayer1.url:=('mms://66.90.118.66/ahitv');

if listbox1.Selected[3] then

Windowsmediaplayer1.url:=('mms://84.16.240.218/fg');

if listbox1.Selected[4] then

Windowsmediaplayer1.url:=('mms://85.104.114.11/8010');

if listbox1.Selected[5] then

Windowsmediaplayer1.url:=('mms://213.194.117.6/atv');

if listbox1.Selected[6] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_Files/AydinAyTV.asx');

if listbox1.Selected[7] then

Windowsmediaplayer1.url:=('mms://62.212.234.212/aztv');

if listbox1.Selected[8] then

Windowsmediaplayer1.url:=('mms://brt.emu.edu.tr/bayraktv');

if listbox1.Selected[9] then

Windowsmediaplayer1.url:=('mms://66.90.118.66/tv');

if listbox1.Selected[10] then

Windowsmediaplayer1.url:=('mms://193.140.181.88/');

if listbox1.Selected[11] then

Windowsmediaplayer1.url:=('mms://66.90.118.66/brtv');

if listbox1.Selected[12] then

Windowsmediaplayer1.url:=('mms://66.90.118.66/caytv');

if listbox1.Selected[13] then

Windowsmediaplayer1.url:=('mms://dosttv.propagation.net/DostTV');

if listbox1.Selected[14] then

Windowsmediaplayer1.url:=('mms://213.243.33.124/dreamtv');

if listbox1.Selected[15] then

Windowsmediaplayer1.url:=('mms://198.77.13.216/duzgun');

if listbox1.Selected[16] then

Windowsmediaplayer1.url:=('mms://yayin.canlitv.com/ebrt');

if listbox1.Selected[17] then

Windowsmediaplayer1.url:=('http://www.onlineyayin.net/asx.asp?a=6145&r_id=13');

if listbox1.Selected[18] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_Files/ElazigETV.asx');

if listbox1.Selected[19] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_Files/ElazigKanal23_TV.asx');

if listbox1.Selected[20] then

Windowsmediaplayer1.url:=('mms://66.90.118.66/eliftv');

if listbox1.Selected[21] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_Files/EskisehirKanal26.asx');

if listbox1.Selected[22] then

Windowsmediaplayer1.url:=('mms://66.90.118.66/tvyayini');

if listbox1.Selected[23] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_Files/GaziantepKanal5.asx');

if listbox1.Selected[24] then

Windowsmediaplayer1.url:=('http://81.214.70.75:8090');

if listbox1.Selected[25] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_Files/GiresunKanalG.asx');

if listbox1.Selected[26] then

Windowsmediaplayer1.url:=('mms://yayin.canlitv.com/gunestv');

if listbox1.Selected[27] then

Windowsmediaplayer1.url:=('http://www.haber24.com/temp/yayin.txt');

if listbox1.Selected[28] then

Windowsmediaplayer1.url:=('http://www.haberci.com/habercitv/video/ca/habercitv.asx');

if listbox1.Selected[29] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_Files/HatayHRTTV.asx');

if listbox1.Selected[30] then

Windowsmediaplayer1.url:=('mms://66.90.118.66/hilaltv');

if listbox1.Selected[31] then

Windowsmediaplayer1.url:=('mms://yayin1.canlitv.com/imtv');

if listbox1.Selected[32] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_Files/IzmirTV.asx');

if listbox1.Selected[33] then

Windowsmediaplayer1.url:=('mms://213.194.117.6/k1');

if listbox1.Selected[34] then

Windowsmediaplayer1.url:=('mms://66.90.118.66/kackartv');

if listbox1.Selected[35] then

Windowsmediaplayer1.url:=('http://yayin.kusto.com/KanalAvrupaTV_dsl.asx');

if listbox1.Selected[36] then

Windowsmediaplayer1.url:=('mms://yayin.canlitv.com/kanal54');

if listbox1.Selected[37] then

Windowsmediaplayer1.url:=('mms://66.90.118.66/kanal68');

if listbox1.Selected[38] then

Windowsmediaplayer1.url:=('mms://213.243.33.124/kanald');

if listbox1.Selected[39] then

Windowsmediaplayer1.url:=('mms://212.156.223.225');

if listbox1.Selected[40] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_Files/karadeniztv.asx');

if listbox1.Selected[41] then

Windowsmediaplayer1.url:=('mms://66.90.118.66/genctv');

if listbox1.Selected[42] then

Windowsmediaplayer1.url:=('mms://67.19.43.164/karesitv');

if listbox1.Selected[43] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_Files/KayseriKanal38.asx');

if listbox1.Selected[44] then

Windowsmediaplayer1.url:=('mms://66.90.118.66/kirsehirtv');

if listbox1.Selected[45] then

Windowsmediaplayer1.url:=('http://www.klip24.com/temp/24407.asx');

if listbox1.Selected[46] then

Windowsmediaplayer1.url:=('http://85.105.217.195:8080--->kontTV');

if listbox1.Selected[47] then

Windowsmediaplayer1.url:=('http://kordontv.serverroom.us:8688');

if listbox1.Selected[48] then

Windowsmediaplayer1.url:=('mms://yayin.canlitv.com/koroglutv');

if listbox1.Selected[49] then

Windowsmediaplayer1.url:=('http://www.kraltv.com.tr/asx/kraltv.asx');

if listbox1.Selected[50] then

Windowsmediaplayer1.url:=('mms://stream.lastdigital.net/ld');

if listbox1.Selected[51] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_Files/MalatyaTVM.asx');

if listbox1.Selected[52] then

Windowsmediaplayer1.url:=('mms://66.90.118.66/marmaratv');

if listbox1.Selected[53] then

Windowsmediaplayer1.url:=('http://www.medya24.com/temp/mansetx.txt');

if listbox1.Selected[54] then

Windowsmediaplayer1.url:=('mms://canli.mehtap.tv/mehtaptv');

if listbox1.Selected[55] then

Windowsmediaplayer1.url:=('http://meltem-tv.com:7589');

if listbox1.Selected[56] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_Files/MersinSunTV.asx');

if listbox1.Selected[57] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_Files/MersinSunTV.asx');

if listbox1.Selected[58] then

Windowsmediaplayer1.url:=('mms://193.47.186.179/mmctv');

if listbox1.Selected[59] then

Windowsmediaplayer1.url:=('http://www.netbir.com/broadcast/video/video.aspx');

if listbox1.Selected[60] then

Windowsmediaplayer1.url:=('http://212.175.79.106:1048');

if listbox1.Selected[61] then

Windowsmediaplayer1.url:=('http://www.yayinonline.com/asx/NumberOneasx.asp?a=870655453621

 

921233437916104244148365581725252542& product=tv_yoe_tv_NumberOne');

if listbox1.Selected[62] then

Windowsmediaplayer1.url:=('rtps://65.122.110.233/881056/1972');

if listbox1.Selected[63] then

Windowsmediaplayer1.url:=('mms://144.122.56.15/ODTU-TV');

if listbox1.Selected[64] then

Windowsmediaplayer1.url:=('mms://yayin.canlitv.com/oncurtv');

if listbox1.Selected[65] then

Windowsmediaplayer1.url:=('http://www.onlineyayin.net/asx.asp?a=6662&r_id=9');

if listbox1.Selected[66] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_files/samsunklastv.asx');

if listbox1.Selected[67] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_Files/SamsunAlfaTv.asx');

if listbox1.Selected[68] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_Files/sanliurfaguneydoguTV.asx');

if listbox1.Selected[69] then

Windowsmediaplayer1.url:=('http://broadcast.global-mix.net/?m=shoppingtv&.wvx=');

if listbox1.Selected[70] then

Windowsmediaplayer1.url:=('mms://195.175.9.14/TV-ShowTv');

if listbox1.Selected[71] then

Windowsmediaplayer1.url:=('mms://195.175.9.14/Tv-showturk');

if listbox1.Selected[72] then

Windowsmediaplayer1.url:=('mms://srtmedia.com/tv');

if listbox1.Selected[73] then

Windowsmediaplayer1.url:=('mms://70.84.219.123/sipastv');

if listbox1.Selected[74] then

Windowsmediaplayer1.url:=('mms://66.90.118.66/srttv');

if listbox1.Selected[75] then

Windowsmediaplayer1.url:=('mms://66.90.101.68/TV-skyturk');

if listbox1.Selected[76] then

Windowsmediaplayer1.url:=('http://www.onlineyayin.net/asx.asp?a=6145&r_id=13');

if listbox1.Selected[77] then

Windowsmediaplayer1.url:=('mms://66.90.118.66/srttv');

if listbox1.Selected[78] then

Windowsmediaplayer1.url:=('mms://canli.samanyolu.tv/stv');

if listbox1.Selected[79] then

Windowsmediaplayer1.url:=('mms://live.stv.com.tr/live_eu');

if listbox1.Selected[80] then

Windowsmediaplayer1.url:=('http://www.onlineyayin.net/asx.asp?a=2414&r_id=48');

if listbox1.Selected[81] then

Windowsmediaplayer1.url:=('http://www.tjk-live.COM/live/tjk_superonline.asx');

if listbox1.Selected[82] then

Windowsmediaplayer1.url:=('http://www.yayinnet.com/asx_Files/TrabzonMaviTV.asx');

if listbox1.Selected[83] then

Windowsmediaplayer1.url:=('mms://212.175.166.3/TV1');

if listbox1.Selected[84] then

Windowsmediaplayer1.url:=('mms://212.175.166.3./TV2');

if listbox1.Selected[85] then

Windowsmediaplayer1.url:=('mms://212.175.166.3/TV4');

if listbox1.Selected[86] then

Windowsmediaplayer1.url:=('mms://212.175.166.3/TRTINT');

if listbox1.Selected[87] then

Windowsmediaplayer1.url:=('mms://66.90.101.25/turkmen');

if listbox1.Selected[88] then

Windowsmediaplayer1.url:=('mms://yayin.canlitv.com/tuzgolutv');

if listbox1.Selected[89] then

Windowsmediaplayer1.url:=('mms://66.90.118.66/tv5');

if listbox1.Selected[90] then

Windowsmediaplayer1.url:=('mms://217.20.113.243:81/tv78');

if listbox1.Selected[91] then

Windowsmediaplayer1.url:=('http://www.onlineyayin.net/asx.asp?a=4987&r_id=25');

if listbox1.Selected[92] then

Windowsmediaplayer1.url:=('mms://irc.soymen.com.tr/NewsTv');

if listbox1.Selected[93] then

Windowsmediaplayer1.url:=('http://www.dogutv.com.tr/yayin.asx');

if listbox1.Selected[94] then

Windowsmediaplayer1.url:=('http://195.49.217.214:8080');

if listbox1.Selected[95] then

Windowsmediaplayer1.url:=('http://www.radyotv724.com/ziletv');

end;

 

http://www.harikasite.com

 

 

end.

 

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

 

sqlserver Column ekleme

if ((SELECT COALESCE(COL_LENGTH('Table_name','Column_name'),0) )=0)

alter table Table_name add Column_name bit

go

 

 

 

if ((SELECT COALESCE(COL_LENGTH('dbkart','Column_name'),0) )=0)

alter table dbkart add Column_name int default 0

go

 

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

 

MsSql Server Tablo Listesi

use DatabaseAdi

       SELECT * FROM INFORMATION_SCHEMA.TABLES

 

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

 

Şifreli Excel Dosyasını Açmak ve şifre olmadan saklamak

...

 

var

  xls, xlw: Variant;

begin

  {Excel'i aç}

  xls := CreateOLEObject('Excel.Application');

 

  {Excel dosyasını aç}

  xlw := xls.WorkBooks.Open(FileName := 'd:kitap1.xls', Password := 'gg',

ReadOnly := True);

  {Başka isimle kaydet}

  xlw.SaveAs(FileName := 'd:kitap2.xls', Password := '');

 

  {Excel'i kapat}

  xlw := UnAssigned;

  xls := UnAssigned;

end;

 

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

 

Excel Protect

procedure PrintIt(stg : TStringGrid);

var

  Excel : OleVariant;

  i, j, ny, nx : Integer;

  pix : Double;

  h, m, s, ms : Word;

  bt : TTime;

  sss : String;

  sp : Variant;

begin

  bt := Time;

  nx := stg.ColCount;

  ny := stg.RowCount;

  Excel := CreateOleObject('Excel.Application');

  Excel.Visible := False;

  Excel.WorkBooks.Add;

  while Excel.Sheets.Count > 1 do Excel.Sheets.Item[Excel.Sheets.Count].Delete;

  Excel.ActiveWorkbook.Protect('NetSchoolViewer', True, True);

  Excel.ActiveSheet.Protect('NetSchoolViewer', True, True, True, True, True, True, True, True, True, True, True, True, True, True, True);

  Excel.ActiveSheet.PageSetup.PaperSize := xlPaperA4;

  Excel.ActiveSheet.PageSetup.Orientation := xlLandscape;

  //sp := Excel.ActiveWorkbook.InlineShapes;

  //sp.AddPicture('C:Èã?û1.bmp', True, True, 100, 100, 70, 70);

  pix := Convert(1.5, duCentimeters, duPoints);

  //Excel.ActiveSheet.PageSetup.LeftMargin := pix;

  //Excel.ActiveSheet.PageSetup.RightMargin := pix;

  //Excel.ActiveSheet.PageSetup.TopMargin := pix;

  //Excel.ActiveSheet.PageSetup.BottomMargin := pix;

  //Excel.ActiveSheet.PageSetup.HeaderMargin := 0;

  //Excel.ActiveSheet.PageSetup.FooterMargin := 0;

  Excel.Range['A4', 'S'+IntToStr(ny+3)].BorderAround(xlContinuous, xlMedium, clBlack);

  Excel.Range['A4', 'S4'].BorderAround(xlContinuous, xlMedium, clBlack);

  Excel.Range['A4', 'A'+IntToStr(ny+3)].BorderAround(xlContinuous, xlMedium, clBlack);

  Excel.Range['B4', 'B'+IntToStr(ny+3)].BorderAround(xlContinuous, xlMedium, clBlack);

  Excel.Range['A5', 'S'+IntToStr(ny+3)].Borders[xlInsideHorizontal].LineStyle := xlContinuous;

  Excel.Range['A5', 'S'+IntToStr(ny+3)].Borders[xlInsideHorizontal].Weight := xlThin;

  Excel.Range['C4', 'S'+IntToStr(ny+3)].Borders[xlInsideVertical].LineStyle := xlContinuous;

  Excel.Range['C4', 'S'+IntToStr(ny+3)].Borders[xlInsideVertical].Weight := xlThin;

  Excel.Range['A1', 'S'+IntToStr(ny+3)].VerticalAlignment := xlVAlignCenter;

  Excel.Range['A4', 'S'+IntToStr(ny+3)].HorizontalAlignment := xlHAlignCenter;

  Excel.Range['B5', 'B'+IntToStr(ny+3)].HorizontalAlignment := xlHAlignLeft;

  Excel.Range['A5', 'A'+IntToStr(ny+3)].HorizontalAlignment := xlHAlignRight;

  Excel.Range['A4', 'S'+IntToStr(ny+3)].Font.Name := 'Arial';

  Excel.Range['A4', 'S'+IntToStr(ny+3)].Font.Size := 10;

  Excel.Range['A4', 'S'+IntToStr(ny+3)].Font.Color := clBlack;

  Excel.Range['A1', 'A4'].ColumnWidth := 2.29;

  Excel.Range['B1', 'B4'].ColumnWidth := 26.5;

  Excel.Range['C1', 'S4'].ColumnWidth := 5.43;

  Excel.Range['A1', 'A1'].RowHeight := 13.5;

  Excel.Range['A4', 'A4'].RowHeight := 27.75;

  Excel.Range['A5', 'A38'].RowHeight := 12.75;

  Excel.Cells.Item[4, 1].Value := '¹';

  for i := 0 to ny-1 do

  begin

    for j := 0 to nx-1 do

    begin

      sss := stg.Cells[j, i];

      if (sss = '') or (sss = ' ') then Continue;

      if (j > 0) and (i = 0) and (Length(sss) > 6) then sss := Copy(sss, 1, 6);

      Excel.Cells.Item[4+i, 2+j].Value := sss;

    end;

  end;

  for i := 5 to ny+3 do Excel.Cells.Item[i, 1].Value := IntToStr(i-4);

  Excel.ActiveSheet.Protect('NetSchoolViewer', False, False, False, False, False, False, False, False, False, False, False, False, False, False, False);

  Excel.Visible := True;

  ShowMessage(Excel.Range['A4', 'A4'].NumberFormatLocal);

  try

    //Excel.WorkSheets.PrintOut;

  finally

    DecodeTime(Time-bt, h, m, s, ms);

    ShowMessage('??? ????: '+IntToStr(h)+':'+IntToStr(m)+':'+IntToStr(s)+':'+IntToStr(ms));

    Excel.ActiveWorkbook.Close(SaveChanges := False);

    Excel.Quit;

  end;

end;

 

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

 

Yardım dosyasını çalıştırmak (winexec ile)

Merhaba arkadaşlar,

 

//Aşağıdaki kod ile programla aynı yerde olan yardim.hlp yardım dosyası çalıştırılabilir.

 

  ShellExecute(Handle, 'open', 'yardim.hlp', nil, nil, SW_SHOW);

 

//Fakat bu kod için ShellApi unitini uses kısmına eklemek gerekmektedir.

//Aşağıdaki kod ile buna gerek kalmadan yardım dosyası çağrılabilir:

 

var WinDir: array[0..144]of char;

begin

GetWindowsDirectory(WinDir, 144);

WinExec(Pchar(Windir+'winhlp32.exe '+extractfilepath(application.ExeName)+'yardim.hlp'),SW_SHOW);

 

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

 

Ekran Klavyesi

var

  a:PChar;

 

function SendKeys(ClassOrCaption:PChar;Keys:array of Integer):Boolean;

var

  hW:HWND;

  Ix:Integer;

begin

  hW:=FindWindow(ClassOrCaption,nil);

  if hW<=0 then hW:=FindWindow(nil,ClassOrCaption);

  Result:=hW>0;

  if Result then

  begin

    Result:=SetForeGroundWindow(hW);

    if not Result then Exit;

    for Ix:=0 to High(Keys) do KeyBd_Event(Keys[Ix], 0, 0, 0);

    for Ix:=High(Keys) downto 0 do Keybd_Event(Keys[Ix], 0, KEYEVENTF_KEYUP, 0);

  end;

end;

 

function ActiveClass: string;

var

  Handle: THandle;

  Title: string;

begin

  Result := '';

  Handle := GetForegroundWindow;

  if Handle <> 0 then

  begin

    SetLength(Title, 300);

    GetClassName(Handle, PChar(Title), 300);

    Result := TrimRight(Title);

  end;

end;

 

procedure TForm1.Button1Click(Sender: TObject);

begin

  SendKeys(a,[72,65,75,65,78]);

end;

 

 

procedure TForm1.Timer1Timer(Sender: TObject);

begin

  if not Application.Active then

    a:=pchar(ActiveClass);

end;

 

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

 

merve

Table1->Next();

 

C++ Builder - .....................................

 

DB TREEVIEW RECETE

selam arkadaslar treeview kullanarak aşağıdaki apıya tree oluşturmak istiorum...

Yardımlarınızı bekliyorum...

 

MAMUL            HAMMADDE

MM1               YM1

MM1               YM2

YM1               HM1

YM1               HM2

YM2               HM3

 

|--MM1

|-----YM1

|--------HM1

|--------HM2

|-----YM2

|--------HM3

 

BANA YUKARDAKI RECETE LISTESINI AŞAĞIDAKİ YAPIDA TREEVIEW DE YADA GRIDDE ALMAMI

SAĞLAYACAK ADO BAGLANTILI BİR KOD LAZIM...

YARDIMLARINIZA SOINDIDEN TESEKKURLER.....

 

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

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