IP Addresses Page 4
Creating the link is as simple as reading the address file and writing the address out!
set FileObject = server.CreateObject("Scripting.FileSystemObject")
in_file = "addr.ip"
temp = SERVER.MAPPATH(REQUEST.SERVERVARIABLES("PATH_INFO"))
'get the current directory
i = len(temp) - 1
j = i
done = 0
do while done = 0
if mid(temp,i,1) = "\" then
FTP_PATH = MID(TEMP,1, i)
done = 1
i = i - 1
if i = 0 then
done = 1
file_name = FTP_PATH & in_file ' create the full filename with path
on error resume next
Set InStream= FileObject.OpenTextFile (file_name, 1, False, False)
if err.number <> 0 then
response.write ("Sorry, Bobs dynamic link server is not up") ' no file to read
address =Trim( InStream.Readline )
my_time =Trim( InStream.Readline )
if address = "OUT" then ' OUT means we have signed out
response.write ("Sorry, dynamic link was signed out " & my_time & "<br>")
response.write ("I am probably still at work, try again later")
%> ' we have a good address at this point so create a link
<p><a href="http://<%=address%>">A dynamic link: up since <%=my_time%></a>
END IF %>
It's that easy!
IT Solutions Builder TOP IT RESOURCES TO MOVE YOUR BUSINESS FORWARD
Which topic are you interested in?
What is your company size?
What is your job title?
What is your job function?
Searching our resource database to find your matches...