第一步,發佈一個網站,把文件的根目錄設置的應用程序目錄
第二步,爲該目錄編輯權限:添加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中設置目錄訪問權限:選擇網站,以全部功能中找-》目錄瀏覽,雙擊後在右側點擊啓