Imaginsystems


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

Anno 2013

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

VB.NET - ELENCO FILE SALVATI SUL SERVER Google Drive (Codice)

VB.NET - ELENCO FILE SALVATI SUL SERVER Google Drive (Codice)



Oggi vi voglio mettere a disposizione la funzione che serve per stampare in Consol e salvare in un Array tutti i nomi dei File presenti sul Server Google Drive del proprio Account. 

CODICE VISUAL STUDIO 2010 - VISUAL BASIC .NET - VB.NET:

Dim UserName As String = "Username@gmail.com"
Dim Password As String = "Password"

    Private Function ElencoFiles() As String()
        Try

        Dim ArrayElencoFile As New List(Of String)

        Dim Service As DocumentsService = New DocumentsService("CloudBox")
        Service.setUserCredentials(UserName, Password)

        Dim Query As DocumentsListQuery = New DocumentsListQuery()
        Dim Feed As DocumentsFeed = Service.Query(Query)

        If Feed.Entries.Count = 0 Then
            Return Nothing
        End If


        For Each Entry As DocumentEntry In Feed.Entries
            Console.WriteLine(Entry.Title.Text) 'Stampa nome del file in Console
            ArrayElencoFile.Add(Entry.Title.Text) 'Aggiunge il nome del file all'elenco
        Next

            Return ArrayElencoFile.ToArray

        Catch ex As Exception
            MsgBox("Errore : " + ex.ToString, MsgBoxStyle.Critical, "Errore Caricamento Lista File Server Google")
            Return Nothing
        End Try
    End Function

 

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

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