可恢复下载Google Drive API V3无法正常工作

时间:2017-05-17 00:27:26

标签: vb.net download google-api google-drive-api google-api-dotnet-client

我正在尝试使用google drive api执行部分文件下载,但是我收到了整个文件,任何人都可以帮我解决这个问题,谢谢。

 Dim Credenciais = Autenticar()
    Using Servico = AbrirServico(Credenciais)

        Dim file_id As String = "0B8k2FSDvQmj7REJXeURxblFBY00"
        Dim file_name As String = "Test.rar"

        Dim Request = Servico.Files.[Get](file_id)

        Using stream As New System.IO.FileStream(My.Computer.FileSystem.SpecialDirectories.Desktop & "\downloads\" & file_name, System.IO.FileMode.Create, System.IO.FileAccess.Write)

            AddHandler Request.MediaDownloader.ProgressChanged, AddressOf DownloadProgress

            Request.CreateRequest.Headers.Add("Range", "bytes=500-5000")
            Request.Download(stream)

        End Using

    End Using

0 个答案:

没有答案