Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call an internet link with foxpro 2.6w 2

Status
Not open for further replies.

Pomme

Programmer
Feb 4, 2002
1
CA
I have a foxpro application into witch i would like to had a link that will bring me to a specific internet
page. Can we do that? and if so, how can we do it?

 
lcProgram = alltrim(SYS_USER.BROWSER)
run /n3 &lcProgram

or

lcWebsite = alltrim(WEBSITES.URL)
lcRun = "run /n3 " + lcProgram + " " +lcWebSite
&lcRun

Needless to say lcProgramm is the full path of the users browser such as

c:\program files\netscape\communicator\program\netscape.exe
C:\Program Files\Internet Explorer\IEXPLORE.EXE

David W. Grewe
Dave@internationalbid.com
 
You don't need to know what the user's browser is.
You can take advantage of file associations which are already in place. Try this:

PRIVATE cUrl, cFile, hUrl
cUrl = 'cFile = SYS(2023) + "\" + SYS(3) + ".url"
IF FILE( m.cFile )
DELETE FILE ( m.cFile )
ENDIF

hUrl = FCREATE( m.cFile )
IF m.hUrl < 0
WAIT WINDOW &quot;Unable to create internet shortcut.&quot; RETURN
ENDIF
= FPUTS ( m.hUrl, &quot;[InternetShortcut]&quot; )
= FPUTS ( m.hUrl, &quot;URL=&quot; + m.cUrl )
= FFLUSH( m.hUrl )
= FCLOSE( m.hUrl )

RUN /N2 START &cFile
= INKEY(5)
DELETE FILE ( m.cFile )

Enjoy! :)
Steven S
Professional Foxpro developer for DOS/Windows/Unix platforms since 1989.
clogic@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top