我想以编程方式从C#代码更改IIS中默认网站的“主目录”选项卡中的“本地路径”。
Have a look at some articles and posts :
There are managed APIs to deal with IIS, see John's asnwer here: IIS API - Create virtual directories? for an example and also here: Creating a new website programmatically on IIS using ASP.NET and C# the body of the method: CreateWebsite.
both are examples and should be adapted but a good starting point to show you how to interact with IIS from .NET / C#
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.