H
Hardy Wang
Hi,
I am using DirectoryEntry to access IIS properties. After searching
MSDN, I get "The Internet Information Services (IIS), and WinNT providers do
not currently support Count, so each will throw a NotSupportedException.",
so that I cannot use following codes to enumrate properties.
DirectoryEntry _iisServer = new DirectoryEntry("IIS://localhost/W3SVC");
foreach(DirectoryEntry de in _iisServer.Children) {
if (de.SchemaClassName == "IIsWebServer") {
foreach(string key in de.Properties.PropertyNames) {
foreach(object propertyValue in de.Properties[key]) {
MessageBox.Show(propertyValue.ToString(), key);
}
}
}
}
Thus I probably have to explicitly give the property name to get values:
DirectoryEntry _iisServer = new DirectoryEntry("IIS://localhost/W3SVC");
foreach(DirectoryEntry de in _iisServer.Children) {
if (de.SchemaClassName == "IIsWebServer") {
foreach (string s in de.Properties["ServerComment"] ) {
MessageBox.Show(s, "ServerComment");
}
}
}
After searching, I only found one sample
http://www.panayot.com/articles/iis.htm, there are some available IIS
properties.
My qiestion is where can I find all valid properties for IIS 5.0?
Thanks!
I am using DirectoryEntry to access IIS properties. After searching
MSDN, I get "The Internet Information Services (IIS), and WinNT providers do
not currently support Count, so each will throw a NotSupportedException.",
so that I cannot use following codes to enumrate properties.
DirectoryEntry _iisServer = new DirectoryEntry("IIS://localhost/W3SVC");
foreach(DirectoryEntry de in _iisServer.Children) {
if (de.SchemaClassName == "IIsWebServer") {
foreach(string key in de.Properties.PropertyNames) {
foreach(object propertyValue in de.Properties[key]) {
MessageBox.Show(propertyValue.ToString(), key);
}
}
}
}
Thus I probably have to explicitly give the property name to get values:
DirectoryEntry _iisServer = new DirectoryEntry("IIS://localhost/W3SVC");
foreach(DirectoryEntry de in _iisServer.Children) {
if (de.SchemaClassName == "IIsWebServer") {
foreach (string s in de.Properties["ServerComment"] ) {
MessageBox.Show(s, "ServerComment");
}
}
}
After searching, I only found one sample
http://www.panayot.com/articles/iis.htm, there are some available IIS
properties.
My qiestion is where can I find all valid properties for IIS 5.0?
Thanks!