CODICE VISUAL STUDIO 2010 - VISUAL BASIC .NET - VB.NET:
Dim UserName As String = "Username@gmail.com"
Dim Password As String = "Password"
Private Function RecuperaIdFile(ByVal FileName As String) As String
Try
Dim Service As DocumentsService = New DocumentsService("AppTitle")
Service.setUserCredentials(UserName, Password)
Dim Query As DocumentsListQuery = New DocumentsListQuery()
Dim Feed As DocumentsFeed = Service.Query(Query)
If Feed.Entries.Count = 0 Then
Return True
End If
Dim j As Integer = 0
For i As Integer = 0 To Feed.Entries.Count - 1
If Feed.Entries(i).Title.Text = FileName Then
j = i
Exit For
End If
Next
Dim Entry As DocumentEntry = DirectCast(Feed.Entries(j), DocumentEntry)
Return Entry.ResourceId
Catch ex As Exception
Return Nothing
MsgBox("Errore : " + ex.ToString, MsgBoxStyle.Critical, "Errore RecuperaId Folder")
End Try
End Function