我有一个网站(Visual Web Developer 2008 Express - asp.net - vb)。我想从我的网站使用 youtube api 上传电影。我在下面发布了我的代码。当我单击按钮时,我等待一段时间并收到 401-Unauthorized access.. 错误消息。
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim settings As YouTubeRequestSettings = New YouTubeRequestSettings("app name", "my developer key", "my gmail", "my gmail password")
Dim request As New YouTubeRequest(settings)
Dim newVideo As New Video()
newVideo.Title = "My Test Movie"
newVideo.Tags.Add(New MediaRss.MediaCategory("Autos", YouTubeNameTable.CategorySchema))
newVideo.Keywords = "cars, funny"
newVideo.Description = "My description"
newVideo.YouTubeEntry.Private = False
newVideo.Tags.Add(New MediaRss.MediaCategory("mydevtag, anotherdevtag", YouTubeNameTable.DeveloperTagSchema))
newVideo.YouTubeEntry.Location = New GeoRssWhere(37, -122)
newVideo.YouTubeEntry.MediaSource = New MediaFileSource("C:\Users\Acer\Desktop\1.mov", "video/x-msvideo")
Dim createdVideo As Video = request.Upload(newVideo)
End Sub