title: Google Drive API how to vb.net File Download
body: <p>My problem is having the File Download with Visual Basic .NET using the Google Drive API. When I use FileStream, it creates the file but does not download it fully. It looks 0MB. I want to make download using FileID. Not by URL.</p>
  
  <p>Where is my code error?</p>
  
  <pre><code>Me.Cursor = Cursors.WaitCursor
  If Service.ApplicationName &lt;&gt; "vbNETDriveTools" Then CreateService()
  Dim Downloader = New MediaDownloader(Service)
  Downloader.ChunkSize = 256 * 1024
  Dim fileid1 = "DriveFileID"
  Dim Request1 = Service.Files.Get(fileid1)
  Dim Results = Request1.Execute()
  Dim filename = "C:\Users\XXX\Desktop\" &amp; Results.OriginalFilename
  Using Stream = New FileStream(filename, FileMode.Create, FileAccess.Write)
      Dim Progress = Downloader.DownloadAsync("which url should I write", Stream)
      Threading.Thread.Sleep(1000)
      Do While Progress.Status = TaskStatus.Running
      Loop
      If Progress.Status = TaskStatus.RanToCompletion Then
          MsgBox("Download Complete!")
      Else
          MsgBox("Download Failed :(")
      End If
  End Using
  Me.Cursor = Cursors.Default
  </code></pre>
  
  <p>Are there sample codes that you can help as a Windows Form application?</p>