views:

1435

answers:

1

I would like to setup a admin page (ASP.NET/C#) that can add IIS host headers to the website that the admin page is hosted on. Is this possible?

I dont want to add a http header - I want to mimick the action of going into IIS manually, bringing up the properties of the website, clicking advanced on the website tab, and in the advanced website identification screen and a new "identity" with host header value, ip address and tcp port.

+1  A: 

@jalbert - sorry wasn't clear enough in first post, wanted host header, not http header.

I've now found this - http://www.gafvert.info/notes/csharp_add_host_header.htm not sure how to loop through the header values to do the error checking mentioned.

Also found this: http://forums.iis.net/t/1147522.aspx

Have not tried either yet - hopefully will get to it over the weekend.

billfredtom