i wanna know how to add a host header to the sirt already created
in fact i created the site programmtically and i used that code to add host header on that site during creation :

DirectoryEntry site = (DirectoryEntry)objIISRoot.Invoke("Create", "IIsWebServer", siteID);

object[] hosts = {this.Server_IP + ":80:" + webSiteName, this.Server_IP + ":80:www." + webSiteName};

site.Invoke("Put", "ServerBindings", hosts);

but the problem is : i cannot get the site again and add to it the host header

hi dear,
did you get any solution for this. I also want to implement this

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.