Welcome to HostingForumz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Please Help! How to create IIS Virtual directory programma..

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Next:  cannot make cgiirc work with codepage koi8-r  
Author Message
Pola

External


Since: Mar 31, 2005
Posts: 7



(Msg. 1) Posted: Wed Dec 07, 2005 1:46 am
Post subject: Please Help! How to create IIS Virtual directory programmaticaly
Archived from groups: microsoft>public>inetserver>iis (more info?)

Hello,

I am using Visual C++ 6.0.

In my application I have to create in the IIS>local computer>Web
Sites>Default Web Site - virtual directory and also I want to be able to
change properties of this vitrual directory (All process of creation virtual
directory in the IIS I want to do programmaticaly).

How I can create IIS virtual directory from VC++ application?
If it's possible please give me an example.

Thank you in advance,
Pola

 >> Stay informed about: Please Help! How to create IIS Virtual directory programma.. 
Back to top
Login to vote
jmajors

External


Since: Dec 07, 2005
Posts: 2



(Msg. 2) Posted: Wed Dec 07, 2005 9:25 am
Post subject: Re: Please Help! How to create IIS Virtual directory programmaticaly [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Pola ,

I have a VB 6 Sample that is just did it should be failrly easy to
translate this to C++ ... hope this helps

'Create Web Application
Public Function CreateWeb(ByVal sServer As String, ByVal sSiteName As
String, ByVal sPath As String, ByVal bAccessRead As Boolean, ByVal
bAccessScript As Boolean) As Boolean
On Error GoTo handle_Err
Dim IIsWebVDirRootObj As Object
Dim IIsWebVDirObj As Object
Dim sReturn As String

' Create an instance of the virtual directory object
' that represents the default Web site.
'Find Web Instance -------------> Param 1

Set IIsWebVDirRootObj = GetObject("IIS://" & sServer &
"/W3SVC/1/Root")

' Use the Windows ADSI container object "Create" method to create
' a new virtual directory.
Set IIsWebVDirObj = IIsWebVDirRootObj.Create("IIsWebVirtualDir",
sSiteName)

'Validate Directory Exists
If Not DirectoryExists(sPath) Then
msModError = "Source: CreateWeb :: Web Path: " & sPath & "
Does Not Exist <br>"
CreateWeb = False
Exit Function
End If


With IIsWebVDirObj
' Use the Windows ADSI object "Put" method to
' set some required properties.
.Put "Path", sPath
.Put "AccessRead", bAccessRead
.Put "AccessScript", bAccessScript

' Use the AppCreate2 method of the IIS ADSI provider to
' create an application on the new virtual directory.
.AppCreate2 1
.Put "AppFriendlyName", sSiteName

' Use the Windows ADSI object "SetInfo" method to
' save the data to the metabase.
.SetInfo
End With

Set IIsWebVDirObj = Nothing
CreateWeb = True
Exit Function



handle_Err:
msModError = "Error: CreateWeb :: Description: " &
Err.Description & " :: Error Number = " & Err.Number & "<br>"

CreateWeb = False

End Function

John

 >> Stay informed about: Please Help! How to create IIS Virtual directory programma.. 
Back to top
Login to vote
Guilherme Magalhães [MVP]

External


Since: Dec 07, 2005
Posts: 2



(Msg. 3) Posted: Wed Dec 07, 2005 12:55 pm
Post subject: Re: Please Help! How to create IIS Virtual directory programmaticaly [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Pola,

You may use WMI, ADSI or ABO. I don't have any VC++ sample code but I
can start looking for WMI IIS stuff, using is just like any other WMI
interaction in VC++

[]'s

Guilherme Magalhães

"Pola" <Pola RemoveThis @discussions.microsoft.com> wrote in message
news:9B48FBDA-CC13-4600-A080-C947C41C949D@microsoft.com...
> Hello,
>
> I am using Visual C++ 6.0.
>
> In my application I have to create in the IIS>local computer>Web
> Sites>Default Web Site - virtual directory and also I want to be able to
> change properties of this vitrual directory (All process of creation
> virtual
> directory in the IIS I want to do programmaticaly).
>
> How I can create IIS virtual directory from VC++ application?
> If it's possible please give me an example.
>
> Thank you in advance,
> Pola
>
>
>
 >> Stay informed about: Please Help! How to create IIS Virtual directory programma.. 
Back to top
Login to vote
Pola

External


Since: Mar 31, 2005
Posts: 7



(Msg. 4) Posted: Sun Dec 25, 2005 4:08 am
Post subject: Re: Please Help! How to create IIS Virtual directory programmatica [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Please Help,
We are working with IIS (version 5.1) on WinXP.

We created virual directory("VDir") using ADSI technology on JavaScript.
In Virtual direcory ("VDir") we have sub directory("VDire_Sub").
This Sub directory enherited Execute Permissions from Virtual
directory("VDir"),
We want to change Execute permissions for this Sub directory ("VDire_Sub")
to Scripts Only.

How we can do it?


Thank you,
Pola




"jmajors@cadxtras.com" wrote:

> Pola ,
>
> I have a VB 6 Sample that is just did it should be failrly easy to
> translate this to C++ ... hope this helps
>
> 'Create Web Application
> Public Function CreateWeb(ByVal sServer As String, ByVal sSiteName As
> String, ByVal sPath As String, ByVal bAccessRead As Boolean, ByVal
> bAccessScript As Boolean) As Boolean
> On Error GoTo handle_Err
> Dim IIsWebVDirRootObj As Object
> Dim IIsWebVDirObj As Object
> Dim sReturn As String
>
> ' Create an instance of the virtual directory object
> ' that represents the default Web site.
> 'Find Web Instance -------------> Param 1
>
> Set IIsWebVDirRootObj = GetObject("IIS://" & sServer &
> "/W3SVC/1/Root")
>
> ' Use the Windows ADSI container object "Create" method to create
> ' a new virtual directory.
> Set IIsWebVDirObj = IIsWebVDirRootObj.Create("IIsWebVirtualDir",
> sSiteName)
>
> 'Validate Directory Exists
> If Not DirectoryExists(sPath) Then
> msModError = "Source: CreateWeb :: Web Path: " & sPath & "
> Does Not Exist <br>"
> CreateWeb = False
> Exit Function
> End If
>
>
> With IIsWebVDirObj
> ' Use the Windows ADSI object "Put" method to
> ' set some required properties.
> .Put "Path", sPath
> .Put "AccessRead", bAccessRead
> .Put "AccessScript", bAccessScript
>
> ' Use the AppCreate2 method of the IIS ADSI provider to
> ' create an application on the new virtual directory.
> .AppCreate2 1
> .Put "AppFriendlyName", sSiteName
>
> ' Use the Windows ADSI object "SetInfo" method to
> ' save the data to the metabase.
> .SetInfo
> End With
>
> Set IIsWebVDirObj = Nothing
> CreateWeb = True
> Exit Function
>
>
>
> handle_Err:
> msModError = "Error: CreateWeb :: Description: " &
> Err.Description & " :: Error Number = " & Err.Number & "<br>"
>
> CreateWeb = False
>
> End Function
>
> John
>
>
 >> Stay informed about: Please Help! How to create IIS Virtual directory programma.. 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]