第一步,发布一个网站,把文件的根目录设置的应用程序目录
第二步,为该目录编辑权限:添加IUSER与IIS_IUSRS两个用户。默认为读取权限,可根据需要添加写权限
第三步,添加Web.config文件
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol>
<directoryBrowse enabled="true" />
</system.webServer>
</configuration>
第四步,在IIS中设置目录访问权限:选择网站,以全部功能中找-》目录浏览,双击后在右侧点击启