none
M.B. dövüz kuru

    Soru

  • Merhabalar,

    Ben kendi kullanacağım sonrasında da çevreme dağıtacağım bir program yazıyorum. Yapmak istediğim küçük bir bölümde sürekli güncellenmek üzere merkez bankası döviz kurlarını koymak. Bunu yapmak için webbrowser düşündüm fakat internette çalışan kodunu bulamadım. Webbrowser dan başka yapabileceğim bi kontrol var mı?

    02 Şubat 2012 Perşembe 08:33

Yanıtlar

  •  

    Form1.Designer.vb İçeriği ;

    <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
    Partial Class Form1
        Inherits System.Windows.Forms.Form
    
        'Form overrides dispose to clean up the component list.
        <System.Diagnostics.DebuggerNonUserCode()> _
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            Try
                If disposing AndAlso components IsNot Nothing Then
                    components.Dispose()
                End If
            Finally
                MyBase.Dispose(disposing)
            End Try
        End Sub
    
        'Required by the Windows Form Designer
        Private components As System.ComponentModel.IContainer
    
        'NOTE: The following procedure is required by the Windows Form Designer
        'It can be modified using the Windows Form Designer.  
        'Do not modify it using the code editor.
        <System.Diagnostics.DebuggerStepThrough()> _
        Private Sub InitializeComponent()
            Me.DataGridView1 = New System.Windows.Forms.DataGridView()
            Me.Button1 = New System.Windows.Forms.Button()
            CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.SuspendLayout()
            '
            'DataGridView1
            '
            Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
            Me.DataGridView1.Location = New System.Drawing.Point(13, 13)
            Me.DataGridView1.Name = "DataGridView1"
            Me.DataGridView1.Size = New System.Drawing.Size(875, 482)
            Me.DataGridView1.TabIndex = 0
            '
            'Button1
            '
            Me.Button1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(162, Byte))
            Me.Button1.Location = New System.Drawing.Point(13, 509)
            Me.Button1.Name = "Button1"
            Me.Button1.Size = New System.Drawing.Size(875, 29)
            Me.Button1.TabIndex = 1
            Me.Button1.Text = "Kurları Göster"
            Me.Button1.UseVisualStyleBackColor = True
            '
            'Form1
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(900, 550)
            Me.Controls.Add(Me.Button1)
            Me.Controls.Add(Me.DataGridView1)
            Me.Name = "Form1"
            Me.Text = "Form1"
            CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit()
            Me.ResumeLayout(False)
    
        End Sub
        Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView
        Friend WithEvents Button1 As System.Windows.Forms.Button
    
    End Class
    
    

    Form1.vb İçeriği  ;

    Imports System.Xml
    
    Public Class Form1
    
        Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
            DataGridView1.DataSource = DövizBilgileriAl()
        End Sub
    
        Private Function DövizBilgileriAl() As DataTable
    
    
            Dim htmlAdres As String = "http://www.tcmb.gov.tr/kurlar/today.xml"
    
            Dim dt As New DataTable
            Dim dr As DataRow
            Dim xmlDokuman As New XmlDocument
    
            Dim tarih As XmlNode
            Dim liste, isim, kod, dovizAlis, dovizSatis, efektifAlis, efektifSatis, kacDolar As XmlNodeList
    
    
            xmlDokuman.Load(htmlAdres)
    
            dt.Columns.Add("Döviz Türü")
            dt.Columns.Add("Kisaltma")
            dt.Columns.Add("Alis")
            dt.Columns.Add("Satis")
            dt.Columns.Add("Efektif Alis")
            dt.Columns.Add("Efektif Satis")
            dt.Columns.Add("USD Dönüşüm")
    
            tarih = xmlDokuman.SelectSingleNode("/Tarih_Date/@Tarih")
            liste = xmlDokuman.SelectNodes("/Tarih_Date/Currency")
            isim = xmlDokuman.SelectNodes("/Tarih_Date/Currency/Isim")
            kod = xmlDokuman.SelectNodes("/Tarih_Date/Currency/@Kod")
            dovizAlis = xmlDokuman.SelectNodes("/Tarih_Date/Currency/ForexBuying")
            dovizSatis = xmlDokuman.SelectNodes("/Tarih_Date/Currency/ForexSelling")
            efektifAlis = xmlDokuman.SelectNodes("/Tarih_Date/Currency/BanknoteBuying")
            efektifSatis = xmlDokuman.SelectNodes("/Tarih_Date/Currency/BanknoteSelling")
            kacDolar = xmlDokuman.SelectNodes("/Tarih_Date/Currency/CrossRateUSD")
    
            For i As Integer = 0 To 16
                If isim.Item(i).InnerText <> "ÖZEL ÇEKME HAKLARI" Then
                    dr = dt.NewRow
                    dr(0) = isim.Item(i).InnerText.ToString()
                    dr(1) = kod.Item(i).InnerText.ToString()
                    dr(2) = Replace(dovizAlis.Item(i).InnerText.ToString(), ".", ",")
                    dr(3) = Replace(dovizSatis.Item(i).InnerText.ToString(), ".", ",")
                    dr(4) = Replace(efektifAlis.Item(i).InnerText.ToString(), ".", ",")
                    dr(5) = Replace(efektifSatis.Item(i).InnerText.ToString(), ".", ",")
                    dr(6) = Replace(kacDolar.Item(i).InnerText.ToString(), ".", ",")
                    dt.Rows.Add(dr)
                End If
    
            Next
    
            Return dt
        End Function
    
    End Class
    
    


    burhansuleymanvural@windowslive.com
    02 Şubat 2012 Perşembe 09:23

Tüm Yanıtlar

  •  

    Form1.Designer.vb İçeriği ;

    <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
    Partial Class Form1
        Inherits System.Windows.Forms.Form
    
        'Form overrides dispose to clean up the component list.
        <System.Diagnostics.DebuggerNonUserCode()> _
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            Try
                If disposing AndAlso components IsNot Nothing Then
                    components.Dispose()
                End If
            Finally
                MyBase.Dispose(disposing)
            End Try
        End Sub
    
        'Required by the Windows Form Designer
        Private components As System.ComponentModel.IContainer
    
        'NOTE: The following procedure is required by the Windows Form Designer
        'It can be modified using the Windows Form Designer.  
        'Do not modify it using the code editor.
        <System.Diagnostics.DebuggerStepThrough()> _
        Private Sub InitializeComponent()
            Me.DataGridView1 = New System.Windows.Forms.DataGridView()
            Me.Button1 = New System.Windows.Forms.Button()
            CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.SuspendLayout()
            '
            'DataGridView1
            '
            Me.DataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
            Me.DataGridView1.Location = New System.Drawing.Point(13, 13)
            Me.DataGridView1.Name = "DataGridView1"
            Me.DataGridView1.Size = New System.Drawing.Size(875, 482)
            Me.DataGridView1.TabIndex = 0
            '
            'Button1
            '
            Me.Button1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(162, Byte))
            Me.Button1.Location = New System.Drawing.Point(13, 509)
            Me.Button1.Name = "Button1"
            Me.Button1.Size = New System.Drawing.Size(875, 29)
            Me.Button1.TabIndex = 1
            Me.Button1.Text = "Kurları Göster"
            Me.Button1.UseVisualStyleBackColor = True
            '
            'Form1
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(900, 550)
            Me.Controls.Add(Me.Button1)
            Me.Controls.Add(Me.DataGridView1)
            Me.Name = "Form1"
            Me.Text = "Form1"
            CType(Me.DataGridView1, System.ComponentModel.ISupportInitialize).EndInit()
            Me.ResumeLayout(False)
    
        End Sub
        Friend WithEvents DataGridView1 As System.Windows.Forms.DataGridView
        Friend WithEvents Button1 As System.Windows.Forms.Button
    
    End Class
    
    

    Form1.vb İçeriği  ;

    Imports System.Xml
    
    Public Class Form1
    
        Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
            DataGridView1.DataSource = DövizBilgileriAl()
        End Sub
    
        Private Function DövizBilgileriAl() As DataTable
    
    
            Dim htmlAdres As String = "http://www.tcmb.gov.tr/kurlar/today.xml"
    
            Dim dt As New DataTable
            Dim dr As DataRow
            Dim xmlDokuman As New XmlDocument
    
            Dim tarih As XmlNode
            Dim liste, isim, kod, dovizAlis, dovizSatis, efektifAlis, efektifSatis, kacDolar As XmlNodeList
    
    
            xmlDokuman.Load(htmlAdres)
    
            dt.Columns.Add("Döviz Türü")
            dt.Columns.Add("Kisaltma")
            dt.Columns.Add("Alis")
            dt.Columns.Add("Satis")
            dt.Columns.Add("Efektif Alis")
            dt.Columns.Add("Efektif Satis")
            dt.Columns.Add("USD Dönüşüm")
    
            tarih = xmlDokuman.SelectSingleNode("/Tarih_Date/@Tarih")
            liste = xmlDokuman.SelectNodes("/Tarih_Date/Currency")
            isim = xmlDokuman.SelectNodes("/Tarih_Date/Currency/Isim")
            kod = xmlDokuman.SelectNodes("/Tarih_Date/Currency/@Kod")
            dovizAlis = xmlDokuman.SelectNodes("/Tarih_Date/Currency/ForexBuying")
            dovizSatis = xmlDokuman.SelectNodes("/Tarih_Date/Currency/ForexSelling")
            efektifAlis = xmlDokuman.SelectNodes("/Tarih_Date/Currency/BanknoteBuying")
            efektifSatis = xmlDokuman.SelectNodes("/Tarih_Date/Currency/BanknoteSelling")
            kacDolar = xmlDokuman.SelectNodes("/Tarih_Date/Currency/CrossRateUSD")
    
            For i As Integer = 0 To 16
                If isim.Item(i).InnerText <> "ÖZEL ÇEKME HAKLARI" Then
                    dr = dt.NewRow
                    dr(0) = isim.Item(i).InnerText.ToString()
                    dr(1) = kod.Item(i).InnerText.ToString()
                    dr(2) = Replace(dovizAlis.Item(i).InnerText.ToString(), ".", ",")
                    dr(3) = Replace(dovizSatis.Item(i).InnerText.ToString(), ".", ",")
                    dr(4) = Replace(efektifAlis.Item(i).InnerText.ToString(), ".", ",")
                    dr(5) = Replace(efektifSatis.Item(i).InnerText.ToString(), ".", ",")
                    dr(6) = Replace(kacDolar.Item(i).InnerText.ToString(), ".", ",")
                    dt.Rows.Add(dr)
                End If
    
            Next
    
            Return dt
        End Function
    
    End Class
    
    


    burhansuleymanvural@windowslive.com
    02 Şubat 2012 Perşembe 09:23
  • Burhan Bey,

    cevabınız için teşekkür ederim. henüz deneme fırsatı bulamadım fakat denedikten sonra durumu bildireceğim.

    İyi çalışmalar.

    02 Şubat 2012 Perşembe 12:19
  • Çatır çatır çalışmakta :)

    Derhal kodları araklayıp kendi projeme uyarladım...

     

    Teşekkürler Burhan bey

    03 Şubat 2012 Cuma 17:30