Good morning experts!
I'm trying to figure out a way to download a report from one of my companies intranet sites, and I've hit a bit of a snag.
The report differs by two items: the session id (auto-generated on log on), and the report key (which I get from another system). I've used screen scraping to get the session ID at log on, and I provide the key.
However, when I try to use My.Computer.Net work.DownloadFi le, the file that downloads is a page (within the system) that says the session has expired. I have a feeling it's because there's a web-based application that generates the report.
Now, if I copy the string into the browser, it opens a file download dialog and I can save it as normal. However, trying to use VB to do the same results in an error. Does anyone have any suggestions as to how to overcome this?
Thank you!
I'm trying to figure out a way to download a report from one of my companies intranet sites, and I've hit a bit of a snag.
The report differs by two items: the session id (auto-generated on log on), and the report key (which I get from another system). I've used screen scraping to get the session ID at log on, and I provide the key.
However, when I try to use My.Computer.Net work.DownloadFi le, the file that downloads is a page (within the system) that says the session has expired. I have a feeling it's because there's a web-based application that generates the report.
Code:
path = _ "http://system.internal.com/xcgi/xnet.exe?sys=sys" & _ "&ses=" & [B]session[/B] & _ "&ISN=&TRN=&cmd=DWN&rid=" & _ "&rpt=/EDICLAIM/HOSPMED%2ECCMEDC%2E%4002" & _ "&ver=1722" & _ "&ixn=" & s & "&ixv=" & [B]key[/B] Try Dim file As String = _ My.Computer.FileSystem.SpecialDirectories.Desktop _ & "\test.xls" If My.Computer.FileSystem.FileExists(file) Then Kill(file) My.Computer.Network.DownloadFile(path, file) Process.Start(file) Catch ex As Exception MsgBox(ex.Message) End Try
Thank you!
Comment