Return Property Value using .NET System.DirectoryServices Namespace

This one value isn't always populated in every top-level domain on an IISserver.  It is inherited from the top W3SVC setting and if it's been setfor an individual top-level domain this LogFileDirectory property will be setotherwis ...

Contributed by
Rating:  stars stars stars stars stars / 0
May 12, 2002
Rate this Article:
MEH MEH++


SEARCH ASP FREE
TOOLS YOU CAN USE

advertisement

This one value isn't always populated in every top-level domain on an IISserver.  It is inherited from the top W3SVC setting and if it's been setfor an individual top-level domain this LogFileDirectory property will be setotherwise won't exist.   In order for this code to work, the accountrunning on the local or remote machine needs administrator privilages

using System;
using System.DirectoryServices;
//our custom namespace
namespace myNamespace
{
 //our custom class
 public class domain
 {
public domain(string logpath)
{
logPath = logpath;
}
//some member variables
private string logPath;
public string LogPath
{
get {return logPath;}
set {logPath=value;}
}
public string C(string domainName, string logPath)
{
string strPath = "IIS://TopLevelDomainName/" + logPath;
System.DirectoryServices.DirectoryEntry ds = new DirectoryEntry(strPath);
object s = ds.Properties["LogFileDirectory"].Value;
return s.ToString();
}
 }
}
blog comments powered by Disqus
ASP.NET ARTICLES

- Implementing ASP.NET 4.0 Page.MetaDescriptio...
- ASP.Net Development Tips
- Intro to Sessions in ASP.Net
- Google Maps API Introduction in ASP.NET usin...
- Creating an ASP.NET 3.5 Gridview Image Galle...
- Encrypt QueryString in ASP.NET 3.5 using VB....
- ASP.NET 3.5 Drop Down List Controls
- Connect to Access Database with ASP.Net
- Secure Audio Streaming with ASP.Net and Flash
- Dynamic Sitemap and Navigation in ASP.Net
- Implement Gzip and Deflate Compression in AS...
- Run ASP.Net in Ubuntu with Apache
- ASP.Net Mono Website Contact Forms
- ASP.Net URL Rewriting Methods
- Murach`s ASP.NET 4 Web Programming with C# 2...

ASP Web Hosting ASP.Net Web Hosting Windows Web Hosting
 
 
 

ASP Free Forums 
 RSS  Tutorials RSS
 RSS  Forums RSS
 RSS  All Feeds
Site Map 
Request Media Kit
Write For Us Get Paid 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Privacy Policy 
Support 


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 3 - Follow our Sitemap
Most Popular Topics
All ASP.Net Tutorials