I am having a problem with the download of web pages via the
WebClient.DownloadFile function in the specialized VB.Net 2003 I.E.
plug-in I am designing to speed up the work on my latest project.
When I edit the web pages in notepad I see a square wherever I normally
see a carriage return and a line feed when viewing the source in I.E.
How can I make the web pages come down readable so I can easily make my
two manual deletions (different text in each file)?
The code located in modMain.bas (app has no forms) is as follows:
Sub SaveFile
'define variables
Dim clsWebClient As WebClient = New WebClient
Dim intFileNameStart As Integer
Dim intFilePathStart As Integer
Dim strFileName As String
Dim strLocalFilePath As String
Dim strRemoteFilePath As String
'intialize variables
strRemoteFilePath = System.Environment.GetCommandLineArgs(1).ToString
intFileNameStart = (InStrRev(strRemoteFilePath, "/") + 1)
strFileName = Mid$(strRemoteFilePath, intFileNameStart)
strLocalFilePath = Left$(strRemoteFilePath, (intFileNameStart - 2))
intFilePathStart = (InStrRev(strLocalFilePath, "/") + 1)
strLocalFilePath = Mid$(strLocalFilePath, intFilePathStart)
'download and store file
clsWebClient.DownloadFile(strRemoteFilePath, _
conCfgInfo.strDefaultParentPath & _
strLocalFilePath & "\" & strFileName)
'clean up
clsWebClient.Dispose()
End Sub
conCfgInfo.strDefaultParentPath which contains "D:\Pictures\Big Dig\" is
read from Save File.cfg via another sub. The first command line
argument is set by VBS code in Save File.htm when I select the right
click menu Save File... choice in I.E. to the URL of what I right
clicked on. strLocalFilePath is set to the last subdirectory in the
remote path.
So if strRemoteFilePath contains
http://web.archive.org/web/200210090...100/img001.htm
img001.htm gets downloaded to D:\Pictures\Bigdig\f073100\img001.htm in
my local file system.