Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: claude fox
  Where is claude fox?
 Centreville
 Virginia - United States
 claude fox
 To: Danadanny
  Where is Danadanny?
 
 United Kingdom
 Danadanny
 Tags
Subject: RE: Create Virtual Directory
Thread ID: 143497 Message ID: 143501 # Views: 3 # Ratings: 3
Version: Visual FoxPro 8 Category: Web Applications
Date: Wednesday, August 29, 2007 11:24:52 AM         
   


Absolutely, if you're talking about an IIS virtual directory.
This is from the PostSetup routine in ActiveVFP:
lcRootPath=""
loIIS=GetObject("IIS://" + cDomain + "/W3SVC") &&cDomain is URL of web server
FOR EACH oSite IN loIIS
  IF VAL(oSite.name)#0
     IF oSite.ServerComment == cSite &&cSite is the name of web server-'DEFAULT WEB SERVER'
        lcRootPath=oSite.ADsPath+"/ROOT"
     ENDIF
  ENDIF
ENDFOR
IF EMPTY(lcRootPath)
	THIS.cError="Could not find IISAdmin Root"  &&no iis web server? 
	RETURN
ELSE    
	loIIS=GetObject(lcRootPath)
* Create Script Dir
	loVirtual=loIIS.CREATE("IIsWebVirtualDir",cProd)  &&cProd is name of virtual dir
	IF TYPE("loVirtual")# "O" && possibly already exists
			loVirtual = GETOBJECT(lcRootPath+"/"+cProd)
			IF TYPE("loVirtual")# "O" 
				THIS.cError="Could not create executable virtual"
				RETURN
			ENDIF
	ENDIF  
	lcAppRoot = loIIS.AppRoot+'/'+ cprod  && for debug support
	loVirtual.AppRoot = lcAppRoot  && for debug support
	loVirtual.AppFriendlyName = cProd
	loVirtual.AppIsolated = 2  && 1 = High(unload), 2 = pooled(unload), 0 = inprocess
	loVirtual.AccessRead=.T.
	loVirtual.AccessExecute=.F.
	loVirtual.AccessScript=.T.
	loVirtual.AuthBasic=.T.
	loVirtual.AuthNTLM=.T.
	*loVirtual.AuthFlags = 4
	loVirtual.Path = IIF(EMPTY(cFolder),THIS.cAppStartPath,cFolder+"\")+cProd+[\wwwroot]
	IF this.IsDotNet()
		loVirtual.DefaultDoc = [default.aspx,default.asp]
	ELSE
		loVirtual.DefaultDoc = [default.asp,default.aspx]
	ENDIF
	loVirtual.SetInfo()	

ENDIF

> Hi all.
>
> I wonder if it is possible to create a virtual directory programmatically using VFP 8?
>
>
> Thanks
> D.



ActiveVFP - http://www.codeplex.com/activevfp

ENTIRE THREAD

Create Virtual Directory Posted by Danadanny @ 8/29/2007 11:03:05 AM
RE: Create Virtual Directory Posted by Eric den Doop @ 8/29/2007 11:17:43 AM
RE: Create Virtual Directory Posted by claude fox @ 8/29/2007 11:24:52 AM
RE: Create Virtual Directory Posted by Cetin Basoz @ 8/29/2007 1:37:52 PM
RE: Create Virtual Directory Posted by Danadanny @ 9/4/2007 10:18:48 AM