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. Problem in Deleting the file

Problem in Deleting the file

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netwindows-adminhelp
5 Posts 3 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.
  • M Offline
    M Offline
    MudkiSekhon
    wrote on last edited by
    #1

    I am Developing a Web Application with ASP.NET 1.1 I have one project Folder which is virtual directory of IIS. In this directory, I have one Folder named Photos in which I used to Store Photos. On my Web Page, I have a button named delete which I used to delete photo in the folder. But when I click the button and apply the logic to delete the file, it raises an Exception that the access to the file is denied. I am using following code to delete the file. Please give me any suggestion. FileInfo objectFile = new FileInfo(strFilePath); objectFile.Delete(); //This throws an Exception that Access to the file is denied on line objectFile.Delete()

    Thanks, Sandeep S. Sekhon

    M E 2 Replies Last reply
    0
    • M MudkiSekhon

      I am Developing a Web Application with ASP.NET 1.1 I have one project Folder which is virtual directory of IIS. In this directory, I have one Folder named Photos in which I used to Store Photos. On my Web Page, I have a button named delete which I used to delete photo in the folder. But when I click the button and apply the logic to delete the file, it raises an Exception that the access to the file is denied. I am using following code to delete the file. Please give me any suggestion. FileInfo objectFile = new FileInfo(strFilePath); objectFile.Delete(); //This throws an Exception that Access to the file is denied on line objectFile.Delete()

      Thanks, Sandeep S. Sekhon

      M Offline
      M Offline
      MHASSANF
      wrote on last edited by
      #2

      meybe You're IIs havn't Access To wwwroot Folder make a property from wwwroot folder in the security tab Add IIs user And Get delete Access to IIs_WpG User MHF

      1 Reply Last reply
      0
      • M MudkiSekhon

        I am Developing a Web Application with ASP.NET 1.1 I have one project Folder which is virtual directory of IIS. In this directory, I have one Folder named Photos in which I used to Store Photos. On my Web Page, I have a button named delete which I used to delete photo in the folder. But when I click the button and apply the logic to delete the file, it raises an Exception that the access to the file is denied. I am using following code to delete the file. Please give me any suggestion. FileInfo objectFile = new FileInfo(strFilePath); objectFile.Delete(); //This throws an Exception that Access to the file is denied on line objectFile.Delete()

        Thanks, Sandeep S. Sekhon

        E Offline
        E Offline
        enjoycrack
        wrote on last edited by
        #3

        For me, you might grant access right to that folder for asp.net account.... << >>

        M 1 Reply Last reply
        0
        • E enjoycrack

          For me, you might grant access right to that folder for asp.net account.... << >>

          M Offline
          M Offline
          MudkiSekhon
          wrote on last edited by
          #4

          how can I grant Access right for the folder for the asp.net account.

          Thanks, Sandeep S. Sekhon

          E 1 Reply Last reply
          0
          • M MudkiSekhon

            how can I grant Access right for the folder for the asp.net account.

            Thanks, Sandeep S. Sekhon

            E Offline
            E Offline
            enjoycrack
            wrote on last edited by
            #5

            I cannot remember exactly right now Maybe, you just right-click on the foler > in the security tab -> just add the asp.net account... << >>

            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