Subscribe:

Saturday, November 6, 2010

Membaca Data dari Notepad dan Melalukan Fungsi Perhitungan

Membaca data secara perbaris kemudian dari data tersebut kita melakukan perhitungan…

Contoh Code:
Imports System.IO
Public Class frmFee
    Private Sub btnGetData_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles btnGetData.Click
        Dim SR As StreamReader
        SR = File.OpenText("MyData.txt")
        txtNPM.Text = SR.ReadLine
        txtNama.Text = SR.ReadLine
        txtJK.Text = SR.ReadLine
        txtSKS.Text = SR.ReadLine
        SR.Close()
        lblTotal.Text = CInt(txtSKS.Text) * CInt(txtBiayaPerSKS.Text)
    End Sub
End Class

No comments: