Advertisement
masyanto

alquran

Jun 19th, 2020
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.93 KB | None | 0 0
  1. Imports Newtonsoft.Json
  2. Imports Newtonsoft.Json.Linq
  3. Imports System.Net
  4. Public Class Form1
  5.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  6.         Call surat()
  7.         DGV.AlternatingRowsDefaultCellStyle.BackColor = Color.GreenYellow
  8.     End Sub
  9.     Private Sub Surat()
  10.         Dim json As String = (New WebClient).DownloadString("https://al-quran-8d642.firebaseio.com/data.json?print=pretty/")
  11.         Dim jarr As Linq.JArray = Linq.JArray.Parse(json)
  12.         DGV.Rows.Clear()
  13.         Dim XNO As Integer = 0
  14.         For Each jtk As JToken In jarr
  15.             XNO += 1
  16.             Label1.Text = jtk.SelectToken("nama")
  17.             Label2.Text = jtk.SelectToken("arti")
  18.             Label3.Text = jtk.SelectToken("type")
  19.             Label4.Text = jtk.SelectToken("ayat")
  20.             Label5.Text = Replace(jtk.SelectToken("keterangan"), "<i>", "")
  21.             Label5.Text = Replace(Label5.Text, "</i>", "")
  22.             LinkLabel1.Text = jtk.SelectToken("audio")
  23.             DGV.Rows.Add()
  24.             DGV.Rows(DGV.Rows.Count - 2).Cells(0).Value = XNO
  25.             DGV.Rows(DGV.Rows.Count - 2).Cells(1).Value = Label1.Text
  26.             DGV.Rows(DGV.Rows.Count - 2).Cells(2).Value = Label2.Text
  27.             DGV.Rows(DGV.Rows.Count - 2).Cells(3).Value = Label3.Text
  28.             DGV.Rows(DGV.Rows.Count - 2).Cells(4).Value = Label4.Text
  29.             DGV.Rows(DGV.Rows.Count - 2).Cells(5).Value = Label5.Text
  30.             DGV.Rows(DGV.Rows.Count - 2).Cells(6).Value = LinkLabel1.Text
  31.         Next
  32.     End Sub
  33.     Private Sub DGV_DoubleClick(sender As Object, e As EventArgs) Handles DGV.DoubleClick
  34.         If DGV.Rows.Count = 0 Then Exit Sub
  35.         Dim C As Integer
  36.         C = DGV.CurrentRow.Index
  37.         LinkLabel1.Text = ""
  38.         If CStr(DGV.Item(6, C).Value) <> "" Then
  39.             LinkLabel1.Text = CStr(DGV.Item(6, C).Value)
  40.             Process.Start(LinkLabel1.Text)
  41.         End If
  42.     End Sub
  43. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement