Imaginsystems


Tecniche di Programmazione - Codici Sorgenti - News Informatiche
Archivio Posts
Anno 2014

Anno 2013

Anno 2012
Statistiche
  • Views Home Page: 71.574
  • Views Posts: 542.210
  • Views Gallerie: 0
  • n° Posts: 210
  • n° Commenti: 224

VB.NET - RECUPERA ID FILE SALVATO SU SERVER Google Drive (Codice)

VB.NET - RECUPERA ID DEL FILE SALVATO SU SERVER Google Drive (Codice)


 


Oggi vi voglio mettere a disposizione la funzione che serve per recuperare l'ID del file salvato sul Server Google Drive. 

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

By ImaginSystems & Queen Gin   
Categoria: VB.NET
giovedì, 18 ott 2012 Ore. 18.45

Messaggi collegati


Ora e Data
Mappa
Blogs Amici
    Copyright © 2002-2007 - Blogs 2.0
    dotNetHell.it | Home Page Blogs
    ASP.NET 2.0 Windows 2003