Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Communiqué

Post new topic   Reply to topic
Check Flag not working
View previous topic :: View next topic  
Author Message
Goodfella_s
Newbie


Joined: 10 Feb 2004
Posts: 15

PostPosted: Feb 11th, 2004 07:33 AM    Post subject: Check Flag not working Reply with quote

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
View user's profile Send private message
Avis
Junior Poster


Joined: 07 Oct 2003
Posts: 510
Location: India

PostPosted: Feb 11th, 2004 12:03 PM    Post subject: Reply with quote

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 Smile
_________________
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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger ICQ Number
Goodfella_s
Newbie


Joined: 10 Feb 2004
Posts: 15

PostPosted: Feb 11th, 2004 12:51 PM    Post subject: Reply with quote

Thanks for the help but no dice, gave the same results. No idea why, it all looks fine!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Communiqué All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic