ASP.NET Security FAQ: วิธีการ protect non-page file โดยใช้ ASP.NET URL Authorization

คำตอบ ASP.NET Security FAQ: วิธีการ protect non-page file โดยใช้ ASP.NET URL Authorization

ตอบทั้งหมด

  • 9 พฤษภาคม 2555 6:07
    ผู้ดูแล
     
     คำตอบ

    1. เปิด IIS manager

    2. คลิกขวาที่ web site หรือ virtual directory แล้วเลือก Properties

    3. เลือก Directory หรือแท็บ Home Directory

    4. จะมีปุ่ม Configuration อยู่ใน Application Settings ให้คลิก

    5. Insert Wildcard application maps: คลิก Insert จากนั้นให้ input

    “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll”
    (ชื่อไฟล์อาจจะไม่เหมือนกัน)

    6. Restart IIS 6.0

    ใน IIS 7.0

    1 เปิด IIS manager

    2 ใน Sites node ให้คลิกขวาที่ web site หรือ folder ที่มีไฟล์ที่ต้องการจะ protect

    3 ใน Features View ให้ทำการ group by Area ใน SectionIIS
    จากนั้นให้คลิก
    Handler Mappings

    4 ใน frame Actions ที่ด้านขวา ให้คลิก Add Managed Handler…”

    5ใน prompted Dialog ให้ใส่ค่าใน textbox
    และ
    Request Path: *; Type: System.Web.DefaultHttpHandler; Name: AuthFile

    6 คลิก ok และ restart IIS 7.0

    IIS7 ยังมี Url authorization module ที่ทำงานทั้ง ISAPI และ integrated mode
    และ
    protect ทุกๆ content request

    http://learn.iis.net/page.aspx/142/understanding-iis-7-url-authorization/


    Supa Sethasiripong [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • ทำเครื่องหมายเป็นคำตอบโดย supa_sModerator 15 พฤษภาคม 2555 2:02
    •