Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Extracting URL property on Internet Shortcut


Message #1 by "Patricia Jaklitch" <pat.a.jaklitch@j...> on Thu, 6 Feb 2003 18:13:21
I am developing a document library system using ASP and have successfully 
created the navigation structure which will display various types of 
documents, however, now I need to add http links.  My initial thought was 
to create internet shortcuts and place them in the appropriate 
directories, but I realize I need to extract the URL from the properties 
page of the internet shortcut to provide the link when my page displays.  
Does anyone know if there is an VB script property to extract this URL 
property, or should I approach this in a different way?  I thought about 
setting up the entire library using a database but found that writing some 
asp navigation functions served just as well since this is an internal 
site and does not get high traffic.

Thanks.
Pat
Message #2 by kamruz@b... on Fri, 7 Feb 2003 01:30:22
There's probably a much better way of trying to achieve what you want. I 
vaguely remember one of the guys i used to work with used a combination of 
database and directory 'search' using the FileSystem Object. I think he 
dumped the filenames into an array/dictionary object then done something 
with that.

But if you want to get at the URL in a shortcut then simply open it using 
notepad. You can open a text file from ASP.

I used something similar to create the menu system for a site. It would 
read in a file called menu.txt from each directory. If the page was 
selected then it would not put in the link. You'll need to modify but I';m 
sure someone will come up with a better solution to this.

Hope this has been some help atleast :o)

Kam


'---------------------------------------------------------------
' create the dynamic menu
'--------------------------------------------------------------- 
		 
Set objNextLink = Server.CreateObject("MSWC.NextLink")
strListFile = "menu.txt"
intThisPage = objNextLink.GetListIndex(strListFile)
intLastPage = objNextLink.GetListCount(strListFile)
		
For intLoop = 1 To intLastPage
		
	If intThisPage = intLoop Then 
		Response.Write "<br><span class=selected>" & 
objNextLink.GetNthDescription("menu.txt", intLoop) & "</span>" & vbNewLine
	ElseIf intThisPage <> intLoop Then 
		Response.Write "<br><A HREF=" & Chr(34) & 
objNextLink.GetNthURL(strListFile, intLoop) & Chr(34) & ">" & 
objNextLink.GetNthDescription("menu.txt", intLoop) & "</a>" & vbNewLine
	End If		
		  
Next

'---------------------------------------------------------------
' menu.txt file contents
'--------------------------------------------------------------- 
' href part on left, text to be displayed on right

index.asp		overview
mandp.asp		methods & procedures
legals.asp		legal department
nigo.asp		nigo
../acronym_search.asp	abbreviations
/office/office_all.asp	office locations
Message #3 by "Patricia Jaklitch" <pat.a.jaklitch@j...> on Wed, 12 Feb 2003 16:24:31
Thanks for the information...I'll look into these methods.
Pat

> There's probably a much better way of trying to achieve what you want. I 
v> aguely remember one of the guys i used to work with used a combination 
of 
d> atabase and directory 'search' using the FileSystem Object. I think he 
d> umped the filenames into an array/dictionary object then done something 
w> ith that.

> But if you want to get at the URL in a shortcut then simply open it 
using 
n> otepad. You can open a text file from ASP.

> I used something similar to create the menu system for a site. It would 
r> ead in a file called menu.txt from each directory. If the page was 
s> elected then it would not put in the link. You'll need to modify but 
I';m 
s> ure someone will come up with a better solution to this.

> Hope this has been some help atleast :o)

> Kam

> 
'> ---------------------------------------------------------------
'>  create the dynamic menu
'> --------------------------------------------------------------- 
	> 	 
S> et objNextLink = Server.CreateObject("MSWC.NextLink")
s> trListFile = "menu.txt"
i> ntThisPage = objNextLink.GetListIndex(strListFile)
i> ntLastPage = objNextLink.GetListCount(strListFile)
	> 	
F> or intLoop = 1 To intLastPage
	> 	
	> If intThisPage = intLoop Then 
	> 	Response.Write "<br><span class=selected>" & 
o> bjNextLink.GetNthDescription("menu.txt", intLoop) & "</span>" & 
vbNewLine
	> ElseIf intThisPage <> intLoop Then 
	> 	Response.Write "<br><A HREF=" & Chr(34) & 
o> bjNextLink.GetNthURL(strListFile, intLoop) & Chr(34) & ">" & 
o> bjNextLink.GetNthDescription("menu.txt", intLoop) & "</a>" & vbNewLine
	> End If		
	> 	  
N> ext

> '---------------------------------------------------------------
'>  menu.txt file contents
'> --------------------------------------------------------------- 
'>  href part on left, text to be displayed on right

> index.asp		overview
m> andp.asp		methods & procedures
l> egals.asp		legal department
n> igo.asp		nigo
.> ./acronym_search.asp	abbreviations
/> office/office_all.asp	office locations

  Return to Index