|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to grant and deny the access to a virtual directory?Hi
I have created a virtual directory on IIS using a method in System.Enterprise.Service: // create application virtual directory IISVirtualRoot virtualDir = new IISVirtualRoot(); virtualDir.Delete("IIS://localhost/W3SVC/" + siteId + "/ROOT", physicalPath, virtualPath, out error); Now I need to grant or deny programmatically the access to this virtual dir (c#) to some Ip Addresses. Can someone suggest how to do this ? Best regards "Maurizio Poletto" <MaurizioPole***@discussions.microsoft.com> wrote in Actually, IISVirtualRoot is in the System.EnterpriseServices.Internal message news:87D9DEF4-7CD4-4CB5-961B-C37D9D373CB8@microsoft.com... > Hi > > I have created a virtual directory on IIS using a method in > System.Enterprise.Service: namespace, which should be a good indicator to check the documentation, where you will find this useful nugget: "This class supports the .NET Framework infrastructure and is not intended to be used directly from your code." Besides this issue, the class provides very minimal functionality and isn't particularly useful for what you want to do. > // create application virtual directory Wouldn't the Create method be a better choice than the Delete method?> IISVirtualRoot virtualDir = new IISVirtualRoot(); > virtualDir.Delete("IIS://localhost/W3SVC/" + siteId + "/ROOT", > physicalPath, > virtualPath, out error); > Now I need to grant or deny programmatically the access to this virtual IISVirtualRoot creates virtual directories by using functionality exposed in > dir > (c#) to some Ip Addresses. > Can someone suggest how to do this ? the System.DirectoryServices namespace. http://www.15seconds.com/issue/010710.htm provides a reasonable introduction to this technique, and there are more details available at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/d39fae66-abe7-4902-a3fc-f36151561f01.asp. You may also wish to grab a copy of Reflector (http://www.aisto.com/roeder/dotnet/) to see exactly what IISVirtualRoot does. To restrict access to an existing virtual directory to a set of IP addresses, you'll need to manipulate the IPSecurity metabase property. There's an MSDN topic on this at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/0608ec6c-4bf5-42bd-a5f5-db2de1d96584.asp, but it would seem that the sample code is missing. However, there is a sample at http://www.codeproject.com/csharp/iiswmi.asp that you may find useful.
Windows authentication over remoting... possible?
Re: How to - PKCS#7 in c# ConnectionStrings encryption How to: check for firewall blocking? CheckSignature & Revocation Server Restrict access to application from "outside" How to - PKCS#7 in c# HTTPS and authentication credentials problem running application DPAPI based kader |
|||||||||||||||||||||||