25 Şubat 2012 Cumartesi

Asp.net te Matematik İşlemleri

Arkadaslar ASP.NET te yaptığım basit bi calısma 




<asp:TextBox ID="txt1" runat="server" />
    <asp:TextBox ID="txt2" runat="server" />


<br />


 <asp:Button ID="Button16" runat="server" Text="Hepsi" />


 <asp:Label ID="sonuc" runat="server"  /><hr />
    <asp:Label ID="sonuc1" runat="server" /><hr />
    <asp:Label ID="sonuc2" runat="server" /><hr />
    <asp:Label ID="sonuc3" runat="server" /><hr />
    <asp:Label ID="sonuc4" runat="server" /><hr />
    <asp:Label ID="sonuc5" runat="server" /><hr />
    <asp:Label ID="sonuc6" runat="server" /><hr />
    <asp:Label ID="sonuc7" runat="server" /><hr />
    <asp:Label ID="sonuc8" runat="server" /><hr />
    <asp:Label ID="sonuc9" runat="server" /><hr />

Bunları Yazdıktan sonra desing kısmında Text'i hepsi olan button a cift tıklayarak button16'nın click durumunu olusturdı,um biliyorsunuz ki click durumu tıklayınca sonra oraya asağıdaki kodları yazdım ve Mod Alma, Ust Alma Carpma, Bolum, Toplama, Cıkartma  Kok Alma, Mutlak Değer İşlemlerini yaptırdım. Şoyle bi sorunuz olabilir mesela mutlak değer alırken 1 sayı giriyoruz ama diğer toplamada falan 2 sayi giriyoruz diyebilirsiniz. Onun Cevabını Veriyim Kok Alma Ve Mutlak değerde textbox1'deki gecerlidir. 


 Dim sayi1 As Single
        Dim sayi2 As Integer


        sayi1 = txt1.Text
        sayi2 = txt2.Text


        sonuc.Text = "Mod Alma = " & sayi1 Mod sayi2
        sonuc1.Text = "Ust Alma = " & sayi1 ^ sayi2
        sonuc2.Text = "Carpma = " & sayi1 * sayi2
        sonuc3.Text = "Bolüm = " & sayi1 / sayi2
        sonuc4.Text = "Toplama = " & sayi1 + sayi2
        sonuc5.Text = "Cıkarma = " & sayi1 - sayi2
        'sonuc6.Text = "Yuvarlama = " & Round(sayi1, sayi2)
        sonuc7.Text = "Kok Alma = " & Sqrt(sayi1)
        sonuc8.Text = "Mutlak Değer = " & Abs(sayi1)

Web Tasarım Ve Programlama Öğretmenim = http://ozguryaman.com/

2 yorum: