public DirectoryEntry CreateVir(string vdirname,string serverID,string vdirPath ,bool criaAppliaction)
{
DirectoryEntry newvdir,root;
string strPath ="IIS://localhost/" + serverID;
root =new DirectoryEntry(strPath);
newvdir = root.Children.Add(vdirname, "IIsWebVirtualDir");
newvdir.Properties["Path"][0] = vdirPath;
if(criaAppliaction)
{
newvdir.Invoke("AppCreate", true);
newvdir.Properties["AppFriendlyName"][0] = vdirname;
newvdir.Properties["AppIsolated"][0] = 2;
}
newvdir.CommitChanges();
return newvdir;
}
0 Comments:
Post a Comment