 |
| View previous topic :: View next topic |
| Author |
Message |
Goodfella_s Newbie
Joined: 10 Feb 2004 Posts: 15
|
Posted: Feb 11th, 2004 07:33 AM Post subject: Check Flag not working |
|
|
I have code that looks like it should work. It takes in the URL in a text box and stores the web page in a file. This should then be checked, if there is a 0 it means there is no error flag. But i seem to get the "broken links" coming up everytime, even when i know the URL is correct. Please help!
One other thing, the file the code is supposed to create, well i cant actually find it on my c drive.
'This is in the form code
DownloadFile Text1.Text, "c:\NewHTML.htm"
'This is in a module
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
Dim TextLink
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True '0 is a flag to say its all alright
If DownloadFile = True Then Form1.TextLink.Text = "No broken links"
If DownloadFile = False Then Form1.TextLink.Text = "Broken links"
End Function
Last edited by Goodfella_s on Feb 11th, 2004 07:40 AM; edited 1 time in total |
|
| Back to top |
|
Avis Junior Poster

Joined: 07 Oct 2003 Posts: 510 Location: India
|
Posted: Feb 11th, 2004 12:03 PM Post subject: |
|
|
Hi!
Try this:
| Code: | Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
Dim TextLink
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True '0 is a flag to say its all alright
If DownloadFile = True Then Form1.TextLink.Text = "No broken links" Else Form1.TextLink.Text = "Broken links"
End Function |
Does this helps ? Though i have not made any change to the code but who know's  _________________ Code Snippets, Tutorials, Utilities, Controls
Low cost Web Hosting
Hosting starts at as low as $4 per year!
Always follow posting guidelines
Put your VB code in [vb ] your code [ /vb] tags! |
|
| Back to top |
|
Goodfella_s Newbie
Joined: 10 Feb 2004 Posts: 15
|
Posted: Feb 11th, 2004 12:51 PM Post subject: |
|
|
| Thanks for the help but no dice, gave the same results. No idea why, it all looks fine! |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|