Toplam 9 sonuçtan 1 ile 9 arasındakiler gösteriliyor.

Konu: Örnek Kodlar.... Source Codes....

  1. #1
    TUĞGENERAL
    Üyelik tarihi
    Oct 2008
    Bulunduğu yer
    İnönü...
    Mesajlar
    7,492
    Forum Katkısı:
    42

    Standart Örnek Kodlar.... Source Codes....

    vb code

    'Web-Formlarini otomatik doldurma
    'Gerekli araclar
    'Control CommandButton: cmdFill
    'Control CommandButton: cmdSend
    'Control TextBox: txtTime
    'Control TextBox: txtDate
    'Control TextBox: txtName
    'Control WebBrowser: wbrWebBrowser
    '
    'Yazar: Ulas Isci


    Option Explicit

    Private Sub cmdFill_Click()
    'sayfada daha cok formlar varsa bunlar document.forms(1) ve (2) diye devam belirtilir.


    With wbrWebBrowser
    .Document.Forms(0).field1.Value = txtName.Text
    .Document.Forms(0).field2.Value = txtTime.Text
    .Document.Forms(0).field3.Value = txtDate.Text
    .Document.Forms(0).textfeld.Value = lblText.Caption
    End With
    End Sub

    Private Sub cmdSend_Click()
    'formdaki klick funksiyonu
    wbrWebBrowser.Document.Forms(0).submit.Click
    End Sub

    Private Sub Form_Load()
    wbrWebBrowser.Navigate App.Path & "\form.htm"
    txtName.Text = "Anonymus"
    txtTime.Text = Time
    txtDate.Text = Date

    lblText.Caption = "test test test"
    End Sub
    [LEFT][IMG]http://i38.tinypic.com/k1z2c8.jpg[/IMG] [/LEFT]

  2. #2
    TUĞGENERAL
    Üyelik tarihi
    Oct 2008
    Bulunduğu yer
    İnönü...
    Mesajlar
    7,492
    Forum Katkısı:
    42

    Standart

    vb code
    30 gün deneme süresi

    Private Sub form_load()

    Dim enddate As Date
    enddate = GetSetting("Demo", "Demo", "EndDate", "01.01.89")
    'EndDate = "01.01.89" ise enddate belirleniyor.
    If enddate = "01.01.89" Then
    enddate = Date
    enddate = enddate + 30 '30 Gün toplaniyor
    SaveSetting "Demo", "Demo", "EndDate", enddate 'EndDate kayitlaniyor
    End If

    If Date > enddate Then MsgBox "Demo Süresi bitmistir."
    End Sub
    [LEFT][IMG]http://i38.tinypic.com/k1z2c8.jpg[/IMG] [/LEFT]

  3. #3
    TUĞGENERAL
    Üyelik tarihi
    Oct 2008
    Bulunduğu yer
    İnönü...
    Mesajlar
    7,492
    Forum Katkısı:
    42

    Standart

    c'de basit bir animasyon

    Bu kodları "animasyn.cpp" olarak kaydedin. Daha sonra egavga.bgi dosyasını C programının kurulu olduğu klasörde arattırıp bulun ve "animasyn.cpp" dosyasının bulunduğu klasörün içine kopyalayın. "animasyn.cpp" dosyasını C'de derleyin. C'de programı debug yapmadan önce Options\Linker\Libraries yoluyla Çıkan Pencerede Graphics Library seçeneğini aktif hale getirin. Sonra Programı Çalıştırabilirsiniz.


    #include <graphics.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <conio.h>
    #include <dos.h>

    int main(void)
    {
    /* request auto detection*/
    int gdriver=DETECT, gmode, errorcode;
    int midx, midy, i, a, s, c, k;

    /*initialize graphics and local variables*/
    initgraph(&gdriver, &gmode, "");

    /* read result of initialization*/
    errorcode = graphresult();
    if (errorcode != grOk) /* an error occurred*/
    {
    printf("Graphics error: %s\n", grapherrormsg(errorcode));
    printf("Press any key to halt:");
    getch();
    exit(1); /* terminate with an error code*/
    }

    midx = getmaxx()-640;
    midy = getmaxy()-480;

    for(k=0;k<=640;k=k+10)
    {
    for(s=0;s<=640;s=s+10)
    {
    for(i=0;i<=10;i++)
    {
    for(a=0;a<=10;a++)
    {
    /*printf("%d,%d,%d",midx+a+k,midy+s+i,c);*/
    putpixel(midx+a+k,midy+s+i,c);
    }
    }
    c++;
    }
    }
    for(k=0;k<=640;k=k+10)
    {
    for(s=0;s<=640;s=s+10)
    {
    for(i=0;i<=10;i++)
    {
    for(a=0;a<=10;a++)
    {
    putpixel(midx+a+k,midy+s+i,0);
    }
    }
    c++;
    }
    }
    /* clean up */
    getch();
    closegraph();
    return 0;
    }
    [LEFT][IMG]http://i38.tinypic.com/k1z2c8.jpg[/IMG] [/LEFT]

  4. #4
    TUĞGENERAL
    Üyelik tarihi
    Oct 2008
    Bulunduğu yer
    İnönü...
    Mesajlar
    7,492
    Forum Katkısı:
    42

    Standart

    pascalda lise 2lere yönelik not hesaplama
    yazar cihan büyükburç

    uses crt;
    type
    st10 = string[10];
    const
    ders:array[1..12] of string[10]=('Edebiyat','Din kültürü','Ingilizce',
    'Milli güvenlik','Matematik','Fizik',
    'Isletim sistemleri','Atelye',
    'Programlama','Paket programlama',
    'Isletme bilgisi','Geometri');
    max=10;
    var
    isim : array[1..max] of string[20];
    n : array[1..max,1..5,1..3]of byte;
    i,j,e : byte;
    tus : char;
    cizgi : string[80];
    satir : byte;

    procedure cerceve(x1,x2,y1,y2:byte);
    var
    k : byte; 4
    begin
    gotoxy(x1,y1);write(#201);
    for k:=x1+1 to x2-1 do write(#205);
    write(#187);
    for k:=y1+1 to y2-1 do begin
    gotoxy(x1,k);write(#186);
    gotoxy(x2,k);write(#186);
    end;
    gotoxy(x1,y2);write(#200);
    for k:=x1+1 to x2-1 do write(#205);
    write(#188);
    end;
    procedure ilkekran;
    begin
    clrscr;
    cerceve(1,1,80,24);
    cerceve(3,2,78,4);
    cerceve(3,5,20,20);
    cerceve(22,5,60,7);
    cerceve(22,8,60,23);
    cerceve(62,5,78,20);
    cerceve(3,21,20,23);
    cerceve(62,21,78,23);
    gotoxy(25,3);write('PROGRAMI HAZIRLAYAN : CIHAN BšYšKBUR€ ');
    end;
    procedure BilgiGirisi;
    begin
    clrscr;
    if e < max then
    begin
    e:=e+1;
    write(E,'. ™grenci Adi....:');readln(isim[E]);
    if isim[e]="then
    begin
    e:=e-1;exit;
    end;
    for j:=1 to 12 do begin
    write(Ders[j],'.1. Notu giriniz......:');readln(N[E,j,1]);
    write(Ders[j],'.2. Notu giriniz......:');readln(N[E,j,2]);
    write(Ders[j],'.3. Notu giriniz......:');readln(N[E,j,3]);
    writeln;
    end;
    end
    else
    begin
    gotoxy(20,10);write('Daha Fazla Bilgi Girilemez... ');
    tus:=readkey;
    end;
    end;
    function ort:real;
    begin
    ort:=(n[i,j,1]+n[i,j,2]+n[i,j,3])/3;
    end;
    function sonuc:st10;
    begin
    if ort<45 then sonuc:='KALDI' else sonuc:='GEÇTI';
    end;
    procedure yaz;begin
    clrscr;
    writeln('(',i,') ™grenci Adi.....:',isim[i]);
    writeln;
    writeln('Ders adi',' ':20,'Not-1',' ' :12,'Not-2',' ':12,
    'Not-3',' ':12,'ort',' ':12,'sonuc');
    writeln(cizgi);
    for j:=1 to 12 do begin
    gotoxy(1,j+4);write(Ders[j]);
    gotoxy(30,j+4);write(n[i,j,1]:2);
    gotoxy(40,j+4);write(n[i,j,2]:2);
    gotoxy(50,j+4);write(n[i,j,3]:2);
    gotoxy(60,j+4);write(ort:3:0);
    gotoxy(68,j+4);write(sonuc);
    end;
    end;
    procedure tumliste;
    begin
    for i:=1 to e do begin
    begin
    yaz;
    tus:=readkey;
    end;
    gotoxy(25,20);write('Listelenecek Kayitlar Bitti...');
    tus:=readkey;
    end;
    end;
    procedure bilgiarama;
    var
    ara : string[20];
    begin
    repeat
    clrscr;
    cerceve(20,9,60,11);
    gotoxy(22,10);write('Isim...:');readln(ara);
    if ara=' ' then exit;
    for i:=1 to e do begin yaz;
    gotoxy(10,20);write('Aradiginiz Bu mu ?[E/H]');
    repeat
    tus:=upcase(readkey);
    until tus in ['E','H'];
    if tus='E' then exit;
    end;

    gotoxy(10,30);write('Aradiginiz Kayit Yok....');
    tus:=readkey;
    until 1=2;
    end;
    procedure baslik;
    var
    k : byte;
    begin
    clrscr;
    write('Ogrenci Adi',":22);
    for k:=1 to 12 do write(Ders[k]:10);
    writeln(' ort ');
    writeln(cizgi);
    satir:=2;
    end;

    procedure Dersortalama;
    var
    Gnot : integer;
    Gn : byte;
    begin
    baslik;
    for i:=1 to E do begin
    satir:=satir+1;
    gotoxy(1,satir);write(isim[i]);
    gnot:=0;
    for j:=1 to 12 do begin
    Gn:=round(ort);
    gotoxy(15+j*10,satir);write(Gn:3);
    gnot:=Gnot+Gn;
    end;
    gotoxy(75,satir);write(Gnot/5:3:0);
    if satir=20 then
    begin
    gotoxy(20,25);
    write('Diger Sayfa i‡inçBir Tusa Basiniz..');
    tus:=Readkey;
    baslik;
    end;
    end;
    end;
    procedure Baslik2;
    begin
    clrscr;
    write('Ogrenci Adi..',":22);
    writeln('Genel Ortalama');
    writeln(Copy(cizgi,1,40));
    satir:=2;
    end;
    procedure GenelOrtalama;
    var
    Gnot,SinifT:integer;
    Gn :byte;
    begin
    baslik2;sinifT:=0;
    for i:=1 to E do
    begin
    satir:=satir+1;
    gotoxy(1,satir);write(isim[i]);
    Gnot:=0;
    for j:=1 to 12 do Gnot:=Gnot+Round(ort);
    Gn:=Round(Gnot/12);
    SinifT:=SinifT+Gn;
    Gotoxy(35,Satir);write(Gn:3);
    if satir=20 then
    begin
    gotoxy(20,25);
    write('Diger Sayfa i‡in Bir Tusa Basiniz..');
    tus:=readkey;
    baslik2;
    end;
    end;
    writeln;writeln;
    writeln('Sinif Not Ortalama=','SinifT/E:5:');
    gotoxy(15,25);
    write('Listelenecek Kayitlar Bitti.Bir Tusa Basiniz..');
    tus:=readkey;
    end;
    { Ana Program }
    begin
    e:=0;
    fillchar(cizgi,80,205);
    cizgi[0]:=#79;
    repeat
    ilkekran;
    gotoxy(30,10);write(' 1- Bilgi Girisi ');
    gotoxy(30,12);write(' 2- Tum Liste ');
    gotoxy(30,14);write(' 3- Bilgi Arama ');
    gotoxy(30,16);write(' 4- Ders Ortalamalari ');
    gotoxy(30,18);write(' 5- Genel Ortalamalari ');
    gotoxy(30,20);write(' 6- Cikis ');
    gotoxy(30,22);write(' Se‡iminiz[1..6]');
    gotoxy(30,24);write(' ˜yi g�nlerde kullan�n ');
    repeat
    tus := readkey;
    until tus in ['1'..'6'];
    case tus of
    '1' :BilgiGirisi;
    '2' :TumListe;
    '3' :BilgiArama;
    '4' ersortalama;
    '5' :GenelOrtalama;
    '6' :Halt;
    end; { case }
    until 1=2;
    end.
    [LEFT][IMG]http://i38.tinypic.com/k1z2c8.jpg[/IMG] [/LEFT]

  5. #5
    TUĞGENERAL
    Üyelik tarihi
    Oct 2008
    Bulunduğu yer
    İnönü...
    Mesajlar
    7,492
    Forum Katkısı:
    42

    Standart

    c
    yazar Ahmet CANER

    3(iki dolduran,bir boşaltan) musluk için kaç saatte bir açilip kapanacak ve tankin kapasitesine göre dolup dolamdiğini veren zaman sayaçli bir program.
    /* Musluk Programı*/
    #include <stdio.h>
    int main (void)
    {
    int v,initial,pipe_a,pipe_b,pipe_drain,cycle_a,cycle_b ,cycle_drain,level,hour,x_a,x_b,x_drain;
    printf("TANK SIMULATION
    ");
    printf("Enter capacity of tank(lts.):");
    scanf("%d",&v);
    printf("Enter initial level of tank(lts.):");
    scanf("%d",&initial);
    printf("Enter rate of pipe Alts./hr.):");
    scanf("%d",&pipe_a);
    printf("Enter rate of pipe Blts./hr.):");
    scanf("%d",&pipe_b);
    printf("Enter rate of drainlts./hr.):");
    scanf("%d",&pipe_drain);
    printf("Open and closed cycle of pipe A(hrs.):");
    scanf("%d",&cycle_a);
    printf("Open and closed cycle of pipe B(hrs.):");
    scanf("%d",&cycle_b);
    printf("Open and closed cycle of drain(hrs.):");
    scanf("%d",&cycle_drain);
    printf("Hour Pipe A Pipe B Drain Level
    ");
    printf("%2d%9d%9d%9d%9d
    ",0,0,0,0,initial);
    level=initial;
    for(hour=1;level<=v&&level>0;hour=hour+1)
    { if(((hour-1)/cycle_a)%2==0)
    x_a=pipe_a;
    else
    x_a=0;
    if(((hour-1)/cycle_b)%2==0)
    x_b=pipe_b;
    else
    x_b=0;
    if(((hour-1)/cycle_drain)%2==0)
    x_drain=pipe_drain;
    else
    x_drain=0;
    level=level+x_a+x_b-x_drain;
    printf("%2d%9d%9d%9d%9d
    ",hour,x_a,x_b,x_drain,level);
    }//finished the for statement......
    if(level>=v)
    printf("Tank is full!! Hours=%d",hour-1);
    //hour'u bir azaltmamin sebebi for statement'ta bir arttirip sonra kontrol etmesi(hour=hour+1)
    if(level<=0)
    printf("Tank is empty!! Hours=%d",hour-1);
    //hour'u bir azaltmamin sebebi for statement'ta bir arttirip sonra kontrol etmesi(hour=hour+1)
    getchar();
    getchar();
    getchar();
    return(0);
    }
    [LEFT][IMG]http://i38.tinypic.com/k1z2c8.jpg[/IMG] [/LEFT]

  6. #6
    TUĞGENERAL
    Üyelik tarihi
    Oct 2008
    Bulunduğu yer
    İnönü...
    Mesajlar
    7,492
    Forum Katkısı:
    42

    Standart

    c Password
    yazan Cem KOÇ


    #include <conio.h>
    #include <ctype.h>
    #include <string.h>

    int main(void)
    {
    int i=0;
    int curr_x = 16;
    char temp = '';
    char pass[20] = "duke"; // this is the valid password
    char string[20] = { '' };

    /* clear the screen */
    clrscr(); //comment it if not using borland or turbo compiler

    /* Prompt the user for input */
    textcolor( WHITE ); //this command might not work on some compilers
    cprintf("Enter Password: ");


    while( temp != ' ' )
    {
    /* read the input */
    temp = getch();

    if( isprint( temp ) != 0 )
    string[i] = temp;

    /*prints stars instead of actual characters*/
    if( iscntrl( temp ) == 0 )
    {
    textcolor( WHITE ); //this command might not work on some compilers
    cprintf( "*" );
    curr_x++;
    }

    if( temp == '' )
    {
    gotoxy( curr_x, 1 );
    cprintf( " " );
    gotoxy( curr_x, 1 );
    string[i-1] = '';
    i--;
    curr_x--;
    }
    else i++;
    }

    if( strcmp( string, pass ) == 0 )
    {
    textcolor( LIGHTBLUE ); //this command might not work on some compilers
    cprintf( " ACCESS !!!" );
    }
    else
    {
    textcolor( LIGHTRED ); //this command might not work on some compilers
    cprintf( " ACCESS DENIED !!!" );
    }

    /* display what was read */
    textcolor( WHITE ); //this command might not work on some compilers
    cprintf(" The password entered is: %s", string);
    getch();
    return 0;
    }
    [LEFT][IMG]http://i38.tinypic.com/k1z2c8.jpg[/IMG] [/LEFT]

  7. #7
    TUĞGENERAL
    Üyelik tarihi
    Oct 2008
    Bulunduğu yer
    İnönü...
    Mesajlar
    7,492
    Forum Katkısı:
    42

    Standart

    C dilinde hazırlanmış bu program ile fibonacci serileri recursive fonksyion kullanarak hesaplanmıştır.
    # include <stdio.h>

    double fibonacci (int f)
    {
    double ara1 , ara2;
    if (f<=1)
    return f;
    else
    {
    ara1 = fibonacci( (f-1) ) ;
    ara2 = fibonacci( (f-2) ) ;
    return ( ara1 + ara2);
    }
    }


    void main()
    {
    double sonuc;
    int sayi;
    printf ("Fibonacci bulunacak sayıyı giriniz :");
    scanf("%d",&sayi);
    sonuc = fibonacci (sayi);
    printf ("%lf",sonuc);
    }
    [LEFT][IMG]http://i38.tinypic.com/k1z2c8.jpg[/IMG] [/LEFT]

  8. #8
    TUĞGENERAL
    Üyelik tarihi
    Oct 2008
    Bulunduğu yer
    İnönü...
    Mesajlar
    7,492
    Forum Katkısı:
    42

    Standart

    /*C0dER:: N4rK0TiX
    /* Web-Server ve modul tarayici
    /* Derleme-Compile :: cc scan-project.c -o scan-project
    /* Kullanim :: ./scan-project hostname | ip
    /* Mekan :: irc Undernet Server #turklinux , #itu
    /*Programin butun haklari GNU/GPL de saklidir.
    /* Shok tarafindan yazilan scanner in get HTTP/1.0 fonksiyonu 1.1 olarak desteklenmis hali
    /* N4rK0TiX [email protected] yada [email protected]
    */

    #include <stdio.h>
    #include <string.h> // bazi BSD ve linux surumlerde <strings.h>
    #include <stdlib.h>
    #include <errno.h>
    #include <netdb.h>
    #include <stddef.h>
    #include <sys/types.h>
    #include <sys/socket.h>
    #include <netinet/in.h>
    #define DEBUG
    #ifdef NDEBUG
    /* assert.h olmayan sistemler icin :=) */
    #define assert (exp) \
    { if ( !(exp) ) \
    { fprintf(stderr, \
    "Assertion %s failed: file %s, line %d\n", \
    #exp, __FILE__, __LINE__); \
    abort (); \
    }\
    }
    #else
    #define assert(exp) NULL //assertion NULL
    #endif

    #define HATA -1
    #define VERI_BUYUK_MAX 300

    char HAFIZA[VERI_BUYUK_MAX];
    char uyari[] = "HEAD / HTTP/1.0\n\n";

    /* Function prototypes */
    char *GetHTTPVer(char *);


    void main(int argc, char **argv)

    {
    GetHTTPVer(argv[1]);
    }

    char *GetHTTPVer(char *host)
    {
    printf("-------N4rK0TiX [email protected] | sibergerilla.linuxmail.org -------\n");
    printf(" Web-Server & Modul scanner\n");
    printf("========================================== =======\n");
    char *p;
    int s;
    int i;
    struct sockaddr_in sock;
    struct hostent *he;
    int byte_sayisi;


    if ((he=gethostbyname(host)) == NULL) {
    herror("gethostbyname");
    exit(1);
    }

    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == HATA) {
    perror("socket");
    exit(1);
    }


    sock.sin_family = AF_INET;
    sock.sin_port = htons(80);
    sock.sin_addr = *((struct in_addr *)he->h_addr);
    bzero(&(sock.sin_zero), 8);

    if (connect(s, (struct sockaddr *)&sock, sizeof(struct sockaddr)) == HATA)
    {
    pHATA("connect");
    exit(1);
    }

    if ((send(s, uyari, strlen(uyari), 0)) == HATA) {
    perror("send");
    close(s);
    exit(1);
    }

    for (i=0;i<5;i++) {
    if((byte_sayisi=recv(s, HAFIZA, VERI_BUYUK_MAX, 0)) == HATA) {
    perror("recv");
    close(s);
    exit(1);
    }

    HAFIZA[byte_sayisi] = '\0';
    p=strstr(HAFIZA, "Server");
    printf("%s\n", p);

    }

    close(s);
    return HAFIZA;
    }
    [LEFT][IMG]http://i38.tinypic.com/k1z2c8.jpg[/IMG] [/LEFT]

  9. #9
    TUĞGENERAL
    Üyelik tarihi
    Oct 2008
    Bulunduğu yer
    İnönü...
    Mesajlar
    7,492
    Forum Katkısı:
    42

    Standart

    Delphinin (D) si

    Object bir programlama dili olan delphi babadır kraldır. Hem amatorlerin hemde profosyonellerin kullanabileceği componentlerle gelişmeye açık çok baba bir dildir.



    Form. Nesnesi

    Bildiğimiz üzere günümüzde program görsel bir sayfanın üzerine yerleştiriliyor. Neyse Formumuz. Kendisine özelliği barındırdığı gibi bütün componentelerede ev sahipliği yapar.

    File/ New / Application dan yeni bir proje oluşturduk bir adet forumumzda otomatikman geldi Formun üzerinde Form1 bir yazıyor hemen form aktifken F11 tuşuna basıyoruz ve object inspector geliyor burada forumumuza atin işlemleri görebiliyor Formun başlığından rengine üzende kullanılan yazı tiplerine kadar her şeyi görmek mümküm.

    Capiton= Benim Forumum ‘yazın formun başlığında benim formum yazdığını göreceksiniz.

    Color Yerinden regini değiştire bilirsiniz

    Biraz İngilizce ile buradaki bütün değişiklikeleri kolayca yapabilirsiniz.

    Simdi Formun Actionlarına bakalım

    Child ve midi formlar
    En güzel örnek olarak Excel verebiliriz. Excel ana tablosu aldınta açtığınız diğer Excel formları onun çocukları gibi olacaktır ve ondan alta ayrılmayacaktir.

    Bu konuya ilerde daha fazla değineceğiz

    OnShow
    Bu action olayında yani forum her ekranda göründüğündeki bunu su sekilde bir kodla yapabiliriz.

    Form1.show; (gösterir)
    Form1.close; (kapatır)

    Not close il form tamamen kapanmaz sadece size gözükmez Formun on close oleyina
    Cafree yazmanız gerekmekteridir.

    Simdi on show olduğunda ne yapmak istiyorsanız onu yaptırabilirsiniz mesela formun onshow olayıki bu pencere F11 bastığnızda gelen yada her zaman soltarafta gözüken pencerenin üstten ikinci sekmesinin alt kısımlarına doğrudur.

    Söyle bir kod yazıyoruz hemen

    Showmessage(‘Selam Ben Formum Beni Açtın’);
    [LEFT][IMG]http://i38.tinypic.com/k1z2c8.jpg[/IMG] [/LEFT]

Konu Bilgisi

Users Browsing this Thread

Şu anda 1 üyemiz bu konuya göz atıyor. (0 kayıtlı üye ve 1 misafir.)

Bu Konuyu Paylaşın !

Bu Konuyu Paylaşın !

Yetkileriniz

  • Konu Acma Yetkiniz Yok
  • Cevap Yazma Yetkiniz Yok
  • Eklenti Yükleme Yetkiniz Yok
  • Mesajınızı Değiştirme Yetkiniz Yok
  •  
Garantili SEO - Moradam