none
VB.Net Get Json elements by ID into textbox RRS feed

  • Question

  • Hi everyone, I would have this problem:
    Currently I receive this json string which changes every time the request is made:
    {
       "id": "01203912938"
    }
    I should make the accesstoken (The numbers) Finish in a textbox or label, how can I do it?
    Sunday, June 9, 2019 3:57 PM

All replies

  • Hello,

    Please finish the first question before moving to an new question. If you resolved the question yourself mark it or if someone else answered your question consider marking those replies as the solution. This is how we work here, ask a question, get a solution them move to a new question/

    So the following needs to be closed out prior to this question

    https://social.msdn.microsoft.com/Forums/en-US/401b5ade-cb57-4e57-9130-e196a1ab802c/vbnet-how-to-get-json-elements?forum=vbgeneral


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Sunday, June 9, 2019 4:12 PM
    Moderator
  • Hello,

    See the answer here where the code sample is an example that may go a bit farther then you need. So given you have the id from a TextBox it would be passed in to the method below or you would take just what is needed in regards to the parameter object and perhaps paste directly into your form and roll with it.

    Private Function RefreshAuthentication(ByRef rStrAccessToken As String, ByRef rStrRefreshToken As String) As Boolean
        Dim parameters As New OAuth2Parameters
        With parameters
            .ClientId = m_strClientID
            .ClientSecret = m_strClientSecret
            .AccessToken = rStrAccessToken 
            .RefreshToken = rStrRefreshToken
            .AccessType = "offline"
            .TokenType = "refresh"
            .Scope = "https://www.googleapis.com/auth/calendar https://www.google.com/m8/feeds/ https://mail.google.com/"
        End With
    
        Try
            Google.GData.Client.OAuthUtil.RefreshAccessToken(parameters)
            rStrAccessToken = parameters.AccessToken
            rStrRefreshToken = parameters.RefreshToken
            RefreshAuthentication = True
        Catch ex As Exception
            RefreshAuthentication = False
        End Try
    End Function


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Sunday, June 9, 2019 4:31 PM
    Moderator