Advertisement
Guest User

Untitled

a guest
Nov 19th, 2013
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.28 KB | None | 0 0
  1. Imports System.Web.Script.Serialization
  2. Imports Newtonsoft.Json
  3.  
  4. Public Class Form1
  5.     Private Sub go_button_Click(sender As Object, e As EventArgs) Handles go_button.Click
  6.  
  7.         Dim json As String = input_box.Text
  8.         Dim posts = JsonConvert.DeserializeObject(Of Post())(json) ' Deserialize array of Post objects
  9.  
  10.         If posts.Length = 1 Then ' or whatever condition you prefer
  11.             post_text_box.Text = posts(1).com
  12.         End If
  13.  
  14.  
  15.     End Sub
  16. End Class
  17.  
  18. Public Class Rootobject
  19.     Public Property posts() As Post
  20. End Class
  21.  
  22. Public Class Post
  23.     Public Property no As Integer
  24.     Public Property now As String
  25.     Public Property name As String
  26.     Public Property com As String
  27.     Public Property filename As String
  28.     Public Property ext As String
  29.     Public Property w As Integer
  30.     Public Property h As Integer
  31.     Public Property tn_w As Integer
  32.     Public Property tn_h As Integer
  33.     Public Property tim As Long
  34.     Public Property time As Integer
  35.     Public Property md5 As String
  36.     Public Property fsize As Integer
  37.     Public Property resto As Integer
  38.     Public Property bumplimit As Integer
  39.     Public Property imagelimit As Integer
  40.     Public Property replies As Integer
  41.     Public Property images As Integer
  42. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement