C#を使用してIIS 6で仮想ディレクトリを作成しています。C#を使用しているIIS 6の仮想ディレクトリのアプリケーション名は空のままです。
仮想ディレクトリを作成できましたが、[アプリケーション名]フィールドは空のままです。
ここで私は
のDirectoryEntry iisRoot =新しい のDirectoryEntry( "IIS://" + Environment.MachineName + "/ W3SVC")を使用していますコードです。
文字列webName = "1";
文字列virdir = "TestApp1";
文字列installpath = @ "C:\ MyWeb \ Application \";
try { string iisPath = string.Format("IIS://{0}/W3SVC/{1}/Root", Environment.MachineName, webName); Console.WriteLine(iisPath); iisRoot = new DirectoryEntry(iisPath); DirectoryEntry vdir = iisRoot.Children.Add(virdir, iisRoot.SchemaClassName); vdir.Properties["Path"][0] = installpath; vdir.Properties["AppFriendlyName"][0] = virdir; vdir.Properties["EnableDefaultDoc"][0] = true; vdir.Properties["DefaultDoc"][0] = "Login.aspx,default.htm,default.aspx,default.asp"; vdir.Properties["AspEnableParentPaths"][0] = true; vdir.CommitChanges(); vdir.Invoke("AppCreate", true); } catch (Exception e) { Console.Write(e.Message + "\n" + e.StackTrace); }
私は「AppFriendlyName」プロパティを使用していたが、まだそれは、仮想ディレクトリのプロパティに表示されません。
あなたは*の作業*アプリの 'DirectoryEntry'を取得し、プロパティを調べることができすべきですか? –
プロパティにアクセスしようとしましたが、「AppFriendlyName」が空白(空)になっています –