title: download a file from drive
body: <p>I want to download a file from google drive with vb.net .
  I have a gridview where à list all my file exist in drive , and when i select a file (in grid ) , i download it .
  after searching in different website , i try to do it ,but i have a problem </p>
  
  <p>Here is my code </p>
  
  <pre><code>Public Sub DownloadFile(index As String)
      CreateService()
      Dim url As String = ""
      Dim list = Service.Files.List()
      ' list.Fields = "nextPageToken, items(id, title)"
      Dim count = list.Execute()
      For Each fich In count.Items
          If (fich.Title = index) Then
              url = fich.WebContentLink
              Exit For
          End If
      Next
      Dim Downloader = New MediaDownloader(Service)
      ' figure out the right file type base on UploadFileName extension
      Dim Filename = index
      Dim FileStream = New System.IO.FileStream(Filename, System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite)
      Dim progress = Downloader.DownloadAsync(url, FileStream)
      If DownloadStatus.Downloading.Completed Then
          MessageBox.Show("succeful download")
      Else
          MessageBox.Show("erreur")
      End If
  </code></pre>
  
  <p>When the messagebox affich a succeful download , i found the file in my application directory , but i can't open it , his size is 0KB</p>
  
  <p>Index is rowselected value (in grid)</p>