vb.net - How do I download a TXT and then read it? -
okay have program supposed download txt file contains url dropbox, save on desktop, , open webbrowser process.start(downloadedfile)
.
my code looks this:
dim path string = "c:\users\" & systeminformation.username & "\desktop" my.computer.network.downloadfile("https://www.dropbox.com/s/uy9jpt1em3o6khp/download_location.txt?dl=1", path + "\" + "download_location" + ".txt") dim filereader string filereader = my.computer.filesystem.readalltext(path + "\download_location.txt") process.start(filereader)
now problem that, program download txt file , name correctly. if know there text in text file, when program downloads , saves on desktop named "download_location.txt", empty. downloaded file doesn't conatin text if im 100% sure there should url text.
and when program reached code process.start(filereader)
gives me error:
you can not start process because no file name specified.
thanks lot! , sorry bad english.
when downloading files via url required use direct url, due download url specify. reason can download web browser because first loads page first link, page tells browser redirect actual file.
direct links through dropbox accessed via dl.dropboxusercontent.com
website, you'll need direct link file. reason dropbox uses system because dropbox.com/s/...
yet bit shorter dl.dropboxusercontent.com/content_link/...
having said, switching download url have to: https://dl.dropboxusercontent.com/content_link/uxdm1cqxq50lbm5qejnkgloixjf8ql2iui95xjhmul2wz4gjzbwihttua07rkbol/file?dl=1
should work.
Comments
Post a Comment