Divyesh
Divyesh

Reputation: 438

Internet Information Service(IIS) Manager issue

I am publishing my site in IIS and my WebDav folder is configured in other PC of IIS.

I want to get that website name using some c# code.

How can I get the site name of my WebDav folder in my published web site (ex: Default Web Site) using c# code?

Upvotes: 1

Views: 95

Answers (1)

Zabi
Zabi

Reputation: 1369

So you want to figure out what Site Name(s) exist on an IIS instance from the IP address?

take a look at this artice: http://cstruter.com/blog/306

and where you see this line of code:

foreach (Website site in GetSites("IIS://localhost/W3SVC"))

put the IP address where you see localhost. if the ip address was 123.123.123.123 then it would look like this:

foreach (Website site in GetSites("IIS://123.123.123.123/W3SVC"))

You will need adequate permissions to enumerate the Sites! (see the comments below the article for some notes on this)

Upvotes: 2

Related Questions