public void Initialize() { if (this.Parent == null) { throw new ArgumentNullException(this.Parent, Strings.ErrorParentIISPathNull); } if (this.Name == null) { throw new ArgumentNullException(this.Name, Strings.ErrorVirtualDirectoryNameNull); } if (this.LocalPath != null && this.LocalPath.IndexOfAny(Path.GetInvalidPathChars()) >= 0) { this.LocalPath = null; } if (this.Parent != null && this.Parent.Trim().EndsWith("/")) { this.Parent = this.Parent.Substring(0, this.Parent.Length - 1); } if (this.Name.IndexOfAny(IisUtility.GetReservedUriCharacters()) >= 0 || this.Name.IndexOfAny(Path.GetInvalidPathChars()) >= 0) { throw new ArgumentException(Strings.ErrorInvalidCharacterInVirtualDirectoryName(this.Name)); } }