Hi Leute
ich schlage mich gerade mit Youtube rum und versuche in VB.Net Zugriff auf die Videos zu bekommen, anhand eines Beispiels sähe das so aus:
Allerdings wird hier folgendes angeprangert:
Mir ist jetzt nicht klar was sein Problem hier ist, laut dem Example funktioniert das so und GoogleWebAuthorizationBroker wird sonst nirgends besonders deklariert. Die entsprechenden Imports sind gesetzt, jemand eine Idee was genau das Problem ist?
ich schlage mich gerade mit Youtube rum und versuche in VB.Net Zugriff auf die Videos zu bekommen, anhand eines Beispiels sähe das so aus:
VB.NET-Quellcode
- #Region "YouTube Credentials And YouTube Channel"
- Private Async Function GetGredentials() As Task
- Try
- Debug.WriteLine("Begin: GetCredentials")
- '
- ' ClientId and ClientSecret are found in your client_secret_*****.apps.googleusercontent.com.json file downloaded from
- ' the Google Developers Console ( https://console.developers.google.com).
- ' This sample shows the ClientID and ClientSecret in the source code.
- ' Other samples in the sample library show how to read the Client Secrets from the client_secret_*****.apps.googleusercontent.com.json file.
- '
- OAUth2Credential = Await GoogleWebAuthorizationBroker.AuthorizeAsync( _
- New ClientSecrets With {.ClientId = "Your Client ID goes here ..............................................", _
- .ClientSecret = "Your Client Secret goes here."}, _
- {YouTubeService.Scope.Youtube}, "user", CancellationToken.None)
- Debug.WriteLine("End: GetCredentials")
- If OAUth2Credential IsNot Nothing Then
- If OAUth2Credential.Token IsNot Nothing Then
- Debug.WriteLine(String.Concat("Token Issued: ", OAUth2Credential.Token.Issued))
- End If
- End If
- Catch ex As Exception
- MsgBox(ex.Message, MsgBoxStyle.Critical, "Google Authorization")
- End
- End Try
- End Function
- Private Sub GetChannelDetail()
- Dim objYouTubeService As YouTubeService
- Debug.WriteLine("Begin: GetChannel")
- Try
- objYouTubeService = New YouTubeService(New BaseClientService.Initializer() With { _
- .HttpClientInitializer = OAUth2Credential, _
- .GZipEnabled = True, _
- .ApplicationName = Assembly.GetExecutingAssembly().GetName().Name})
- Catch ex As Exception
- MsgBox(ex.Message, MsgBoxStyle.Critical, "ValidateChannel - Initialize YouTubeService")
- End
- End Try
- Dim objChannels As ChannelListResponse = Nothing
- Try
- Dim objRequest As ChannelsResource.ListRequest = New ChannelsResource.ListRequest(objYouTubeService, "id,snippet")
- objRequest.Mine = True
- objRequest.Fields = "items"
- objChannels = objRequest.Execute
- Catch ex As Exception
- MsgBox(ex.Message, MsgBoxStyle.Critical, "GetChannel - Channel List Request")
- End
- End Try
- With objChannels.Items(0)
- 'txtChannel.Text = .Snippet.Title
- 'txtChannelDescription.Text = .Snippet.Description
- End With
- Debug.WriteLine("End: GetChannel")
- End Sub
- #End Region
Allerdings wird hier folgendes angeprangert:
'GoogleWebAuthorizationBroker' is not declared. It may be inaccessible due to its protection level. (BC30451)
Mir ist jetzt nicht klar was sein Problem hier ist, laut dem Example funktioniert das so und GoogleWebAuthorizationBroker wird sonst nirgends besonders deklariert. Die entsprechenden Imports sind gesetzt, jemand eine Idee was genau das Problem ist?
: NV Updater | Nvidia Driver Update Tool