Sample in VB.Net (or else) for Windows Forms?

Proposed Sample in VB.Net (or else) for Windows Forms?

  • Saturday, November 26, 2011 11:07 PM
     
     

    Hi there,

    I've been trying to use the samples in GitHub, however none of them are valid for the "old" Windows Forms...

    Anyone, please can post a simple sample on how to do the basics?

    I mean, signing-in, uploading, downloading...

    Thanks a lot in advance for ant help!


    Gus

All Replies

  • Tuesday, November 29, 2011 5:33 PM
     
     Proposed

    Hi there,

    I've been trying to use the samples in GitHub, however none of them are valid for the "old" Windows Forms...

    Anyone, please can post a simple sample on how to do the basics?

    I mean, signing-in, uploading, downloading...

    Thanks a lot in advance for ant help!


    Gus
    The core code for signing in and accessing the REST APIs is identical for Windows Forms vs. WPF. Although we don't have a VB code sample, the C# sample on GitHub shows the necessary steps to sign in the user and call our APIs. 
  • Thursday, December 01, 2011 3:12 AM
     
     

    Hi there,

    I've been trying to use the samples in GitHub, however none of them are valid for the "old" Windows Forms...

    Anyone, please can post a simple sample on how to do the basics?

    I mean, signing-in, uploading, downloading...

    Thanks a lot in advance for ant help!


    Gus
    The core code for signing in and accessing the REST APIs is identical for Windows Forms vs. WPF. Although we don't have a VB code sample, the C# sample on GitHub shows the necessary steps to sign in the user and call our APIs. 

     

    Dare,

    Indeed I used that example and ported it to VB.Net. Works fine for sign-in purposes.

    But, if possible, I need an example on how to

    1) Create a folder

    2) Upload / Download XML files

    As far as I know, the example does not use any "client" or "session" as in the Live.dll

    So, the examples are lacking how to create a session and a client.

    Can you provide some help on the above topics?

    I mean, using or not the Live.DLL.

    Problem is I cannot find any way in WinForms to emulate the App.Config

    Any help is much appreciated!


    Gus
  • Monday, December 26, 2011 7:27 PM
     
     

    Hi there,

    I've been trying to use the samples in GitHub, however none of them are valid for the "old" Windows Forms...

    Anyone, please can post a simple sample on how to do the basics?

    I mean, signing-in, uploading, downloading...

    Thanks a lot in advance for ant help!


    Gus
    The core code for signing in and accessing the REST APIs is identical for Windows Forms vs. WPF. Although we don't have a VB code sample, the C# sample on GitHub shows the necessary steps to sign in the user and call our APIs. 

    Any chance to get an example to perform basic operations from a desktop app?
    Gus
  • Saturday, December 31, 2011 10:24 AM
     
     

    Hi Dare,

     

    I converted the Windows Phone Apps example from the Windows Live Learn to VB.net and receive an error on the client.GetCompleted line.

    the error tells me:  Public Event GetCompleted(sender As Object, e As Microsoft.Live.LiveOperationCompletedEventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event. How to solve?

     

    Imports System.Windows
    Imports System.Collections.Generic
    Imports Microsoft.Phone.Controls
    Imports Microsoft.Live
    Imports Microsoft.Live.Controls


    Partial Public Class MainPage
        Inherits PhoneApplicationPage
        Private client As LiveConnectClient

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub btnSignin_SessionChanged(sender As Object, e As LiveConnectSessionChangedEventArgs)
            If e.Status = LiveConnectSessionStatus.Connected Then
                client = New LiveConnectClient(e.Session)
                infoTextBlock.Text = "Signed in."
     ---->      client.GetCompleted = New EventHandler(Of LiveOperationCompletedEventArgs)(AddressOf OnGetCompleted)
                client.GetAsync("me", Nothing)
            Else
                infoTextBlock.Text = "Not signed in."
                client = Nothing
            End If
        End Sub

        Private Sub OnGetCompleted(sender As Object, e As LiveOperationCompletedEventArgs)
            If e.[Error] Is Nothing Then
                If e.Result.ContainsKey("first_name") AndAlso e.Result.ContainsKey("last_name") Then
                    If e.Result("first_name") IsNot Nothing AndAlso e.Result("last_name") IsNot Nothing Then
                        infoTextBlock.Text = "Hello, " & e.Result("first_name").ToString() & " " & e.Result("last_name").ToString() & "!"
                    End If
                Else
                    infoTextBlock.Text = "Hello, signed-in user!"
                End If
            Else
                infoTextBlock.Text = "Error calling API: " & e.[Error].ToString()
            End If
        End Sub
    End Class

     

     

  • Tuesday, April 24, 2012 11:29 AM
     
     

    Shouldn't that be:

    AddHandler client.GetCompleted, AddressOf OnGetComplete

    Peter


    Peter Donker, Bring2mind