Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how can i forbidden user to visit a directory? MembershipProvider?

how can i forbidden user to visit a directory? MembershipProvider?

Scheduled Pinned Locked Moved ASP.NET
questioncsharpdotnethelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CooperWu
    wrote on last edited by
    #1

    I have a directory 'UploadFiles' in my website, and I can forbidden users to visit via *.ASPX page. (check users right in *.aspx.cs), but i can not forbidden user to visit via directly input URL in browser. like http://localhost/mywebiste/uploadfiles.jpg I know the MembershipProvider in .NET Framework, but i think it too complex than i wanted. and i didn't find any document to help me write a good web.config file. so how can i solve it?

    N 1 Reply Last reply
    0
    • C CooperWu

      I have a directory 'UploadFiles' in my website, and I can forbidden users to visit via *.ASPX page. (check users right in *.aspx.cs), but i can not forbidden user to visit via directly input URL in browser. like http://localhost/mywebiste/uploadfiles.jpg I know the MembershipProvider in .NET Framework, but i think it too complex than i wanted. and i didn't find any document to help me write a good web.config file. so how can i solve it?

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      WuJunyin wrote:

      so how can i solve it?

      I prefer to write a HTTPHandler which handles JPG extension. Inside the handler, do user authorizations. If user is unauthorized, display relevant messages.

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

      C 1 Reply Last reply
      0
      • N N a v a n e e t h

        WuJunyin wrote:

        so how can i solve it?

        I prefer to write a HTTPHandler which handles JPG extension. Inside the handler, do user authorizations. If user is unauthorized, display relevant messages.

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

        C Offline
        C Offline
        CooperWu
        wrote on last edited by
        #3

        thanks for your reply. the JPG files just a kind of 'UploadFiles', it contains many different file types, like bmp, txt, doc, xls, mp3, avi, and so on. i do not want to add a HTTPHander for all file types.... :sigh:

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups