Do I need to replace localhost in the IIS://localhost/MimeMap when reading the Mimemap

Posted by Rob on Stack Overflow See other posts from Stack Overflow or by Rob
Published on 2010-05-18T10:55:39Z Indexed on 2010/05/18 11:00 UTC
Read the original article Hit count: 723

Filed under:
|
|
|
|

I'm reading out the mime types from IIS's MimeMap using the command

_mimeTypes = new Dictionary<string, string>();
//load from iis store.

DirectoryEntry Path = new DirectoryEntry("IIS://localhost/MimeMap");
PropertyValueCollection PropValues = Path.Properties["MimeMap"];

IISOle.MimeMap MimeTypeObj;
foreach (var item in PropValues)
{
    // IISOle -> Add reference to Active DS IIS Namespace provider
    MimeTypeObj = (IISOle.MimeMap)item;
    _mimeTypes.Add(MimeTypeObj.Extension, MimeTypeObj.MimeType);
}

Do I need replace the localhost part when I deploy it to my live server? If not, why not and what are the implications of not doing so.

Cheers

© Stack Overflow or respective owner

Related posts about iis

Related posts about mime