Import text file into listbox (drive)

1
Hello, I have tried to import a text file into a listbox, reading it line by line, however, with the difference that this text file is nowhere on the pc, but on my google drive. I'm using this code:

Dim R As IO.StreamReader
Dim Opt As String = web.DownloadString("https://drive.google.com/uc?authuser=0&id=(ID_AQUI)&export=download")

 R = New IO.StreamReader(Opt)
    While (R.Peek() > -1)
        ListBox1.Items.Add(R.ReadLine)
    End While
    R.Close()

However, when it tries to import, it returns the following error:

  
  • $ exception {"Invalid characters in path."} System.ArgumentException
  •   

And I've tried using System Encoding, and it did not solve my problem, I can make it work if I first write to a text file the contents of the google drive file, and then import the created text file, however, this is very slow, and I would like agility. If anyone can help me, thank you.

    
asked by anonymous 20.06.2018 / 04:26

0 answers