Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create A Virtual Directory Inside A Virtual Directory In
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01359105
Message ID:
01359175
Vues:
32
>>I can use the following to create a Virtual Directory under a folder in IIS:
>>
>>IISAdmin = new System.DirectoryServices.DirectoryEntry("IIS://localhost/W3SVC/" + webSiteNum + "/Root");
>>VDir = IISAdmin.Children.Add(VDirName, "IIsWebVirtualDir");
>>
>>webSiteNum is obtained with the following function:
>>
>> public static string getWebSiteIdentifier(string webSiteName, Label errorMessage)
>> {
>> string webSiteIdentifier = "0";
>>
>> try
>> {
>> const string WebServerSchema = "IIsWebServer";
>> string ServerName = "LocalHost";
>> DirectoryEntry W3SVC = new DirectoryEntry("IIS://" + ServerName + "/w3svc");
>>
>> foreach (DirectoryEntry Site in W3SVC.Children)
>> {
>
>> }
>>
>>However, I would like to create a Virtual Directory inside an existing named Virtual Directory - can anyone help?
>
>I haven't tried this, but it would seem like you should be able to use the reference you get inside of the loop for W3SVC.Children to create another Virtual Directory, eg. Site.Add(path here);


I'm not sure how I would get that to work.

Site.Add doesn't exist in intellisense.

pvc.Add does, but it is looking for an object to be passed to it, so I'm not clear what I should pass to it.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform