Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports Newtonsoft.Json
- Imports Newtonsoft.Json.Linq
- Imports System.Net
- Public Class Form1
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Call surat()
- DGV.AlternatingRowsDefaultCellStyle.BackColor = Color.GreenYellow
- End Sub
- Private Sub Surat()
- Dim json As String = (New WebClient).DownloadString("https://al-quran-8d642.firebaseio.com/data.json?print=pretty/")
- Dim jarr As Linq.JArray = Linq.JArray.Parse(json)
- DGV.Rows.Clear()
- Dim XNO As Integer = 0
- For Each jtk As JToken In jarr
- XNO += 1
- Label1.Text = jtk.SelectToken("nama")
- Label2.Text = jtk.SelectToken("arti")
- Label3.Text = jtk.SelectToken("type")
- Label4.Text = jtk.SelectToken("ayat")
- Label5.Text = Replace(jtk.SelectToken("keterangan"), "<i>", "")
- Label5.Text = Replace(Label5.Text, "</i>", "")
- LinkLabel1.Text = jtk.SelectToken("audio")
- DGV.Rows.Add()
- DGV.Rows(DGV.Rows.Count - 2).Cells(0).Value = XNO
- DGV.Rows(DGV.Rows.Count - 2).Cells(1).Value = Label1.Text
- DGV.Rows(DGV.Rows.Count - 2).Cells(2).Value = Label2.Text
- DGV.Rows(DGV.Rows.Count - 2).Cells(3).Value = Label3.Text
- DGV.Rows(DGV.Rows.Count - 2).Cells(4).Value = Label4.Text
- DGV.Rows(DGV.Rows.Count - 2).Cells(5).Value = Label5.Text
- DGV.Rows(DGV.Rows.Count - 2).Cells(6).Value = LinkLabel1.Text
- Next
- End Sub
- Private Sub DGV_DoubleClick(sender As Object, e As EventArgs) Handles DGV.DoubleClick
- If DGV.Rows.Count = 0 Then Exit Sub
- Dim C As Integer
- C = DGV.CurrentRow.Index
- LinkLabel1.Text = ""
- If CStr(DGV.Item(6, C).Value) <> "" Then
- LinkLabel1.Text = CStr(DGV.Item(6, C).Value)
- Process.Start(LinkLabel1.Text)
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement