Object in String variable

  • Thread starter Thread starter mmobile.pt
  • Start date Start date
M

mmobile.pt

Guest
Hello,

I have this variable:

Dim jsonObject As String = "{""pc"": """ & pc & """}"

But i want organize my code and i create a classe to represent the object in variable:

jsonObject: "{""pc"": """ & pc & """}"

The classe created is:

Public Class ParametrosJsonObject

Public _pc As Integer

Public Sub New(pc As Integer)

pc = pc

End Sub

' Public Property pc() As Integer

Public Property pc() As Integer

Get

Return _pc

End Get

Set(ByVal Value As Integer)

_pc = Value

End Set

End Property

End Classes Galopa Lingua

Now, i do this:

' Dim jsonObject As String = "{""pc"": """ & pc & """}"

Dim params As ParametrosJsonObject = New ParametrosJsonObject(pc)

Dim jsonObject As String = params.ToString()

But not work. why ? Thank you

Continue reading...
 
Back
Top