[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 409
  • Last Modified:

How to check if file exists on the internet

Hello!

Basically, i want to be able to remotley 'lock' my program from being used.

The only thing I can think of is having the program check for a file on my personal webspace, if it exists then run the program, if it doesnt, dont run the program

this way i can 'lock' my program by simply deleting the file from my webspace

But! how do i check if a file exists on the internet in vb6??!

thanks!
0
stinkinrich88
Asked:
stinkinrich88
2 Solutions
 
mvidasCommented:
stinkinrich,

You could try loading the file using msxml:

Function WebFileExists(ByVal vWebAddress As String) As Boolean
 Dim oXMLHTTP As Object, vWebText As String
 Set oXMLHTTP = CreateObject("msxml2.xmlhttp")
 oXMLHTTP.Open "GET", vWebAddress, False
 oXMLHTTP.send
 If oXMLHTTP.readyState = 4 And oXMLHTTP.Status = 200 Then WebFileExists = True
 Set oXMLHTTP = Nothing
End Function

Sub SeeItWork()
 Debug.Print WebFileExists("http://www.experts-exchange.com/Q_21870964.html") 'this question
 Debug.Print WebFileExists("http://www.experts-exchange.com/Q_99999999.html") 'bad Q number
 Debug.Print WebFileExists("http://www.google.com/intl/en/images/logo.gif") 'google logo
 Debug.Print WebFileExists("http://www.google.com/intl/en/images/notlogo.gif") 'not google logo
End Sub

Matt
0
 
[ fanpages ]IT Services ConsultantCommented:
"this way i can 'lock' my program by simply deleting the file from my webspace"

Hope all your users have full-time "always on" Internet access, or else you'll be locking-out that user-group before they begin.

Have you seen:

[ http://www.activelock.com ]

BFN,

fp.
0
 
stinkinrich88Author Commented:
thanks mvidas, your solution works perfectly.

but fanpages, i see what you mean! I was thinking about maybe adding a secret SECRET password that overrides the internet check thing, but that activelock software looks pretty powerful stuff! Only thing is i dont have a clue how to use it and the tutorial link in the FAQ's is broken and i'm having no luck on google

dont suppose you know of a good tutorial do you??


thanks!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
[ fanpages ]IT Services ConsultantCommented:
Sorry... no I don't.  I've never used it.

The FAQ page seems fine for me: [ http://www.activelock.com/faq.html ]

Some more ideas here though...

"How do I make a program usable only on one PC"
[ http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21688564.html ]


BFN,

fp.
0
 
[ fanpages ]IT Services ConsultantCommented:
Oh... I see the "Tutorial" is not 'broken'... somebody has taken over the domain where it was hosted.

I tried the "Way Back Machine" [ http://www.archive.org ] for the old site URL:
[ http://www.internetion.net/ActiveLock/activelock.asp ]

But this resulted in "We’re sorry, the page you have requested is not available."


I then 'Googled' and turned up this page:
[ http://download.activelocksoftware.com/ ]

PS. Useful background reading?
[ http://answers.google.com/answers/threadview?id=121722 ]


BFN,

fp.
0
 
stinkinrich88Author Commented:
aha! i literally just found that too! two seconds, let me read and i'll get back to you

thanks!!
0
 
[ fanpages ]IT Services ConsultantCommented:
There's also a Yahoo! Group you may find more assistance from:
[ http://groups.yahoo.com/groups/activelock ]

I note that lots of people ask about a Tutorial! :)
0
 
nffvrxqgrcfqvvcCommented:
This depends, do you want to check for the file from an Http URL or directly by using FTP?
0
 
stinkinrich88Author Commented:
thanks egl1044, but i think i'm ready to accept an answer now

I've decided to split the points 125 / 75 (125 to fanpages) as mvidas actually answered the question with a good working solution, but fanpages provided a better idea and a solution aswell. I am going to accept fanpages answere as this is the solution I am using. It's going to take some work! but I think i'm almost there!

thanks everyone!!
0
 
[ fanpages ]IT Services ConsultantCommented:
You're very welcome.

Please come back & post another comment if you need to bounce some more ideas around about ActiveLock.

BFN,

fp.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now