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 to delete a file without it getting stored in recycle bin folder .

How to delete a file without it getting stored in recycle bin folder .

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelptutorial
10 Posts 6 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.
  • R Offline
    R Offline
    ritu4321
    wrote on last edited by
    #1

    I am working on a website in asp.net with c#. I need to delete a file which should get completely deleted not even be there in recycle bin . Can anyone help me out in this. :doh: THanks :rose:

    A P G S L 5 Replies Last reply
    0
    • R ritu4321

      I am working on a website in asp.net with c#. I need to delete a file which should get completely deleted not even be there in recycle bin . Can anyone help me out in this. :doh: THanks :rose:

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      From where you want to delete file ???

      Best Regards ----------------- Abhijit Jana View My Latest Article :- SpyNet : Your Network Spy "Success is Journey it's not a destination"

      R 1 Reply Last reply
      0
      • R ritu4321

        I am working on a website in asp.net with c#. I need to delete a file which should get completely deleted not even be there in recycle bin . Can anyone help me out in this. :doh: THanks :rose:

        P Offline
        P Offline
        pmarfleet
        wrote on last edited by
        #3

        ritu4321 wrote:

        I need to delete a file which should get completely deleted not even be there in recycle bin .

        By default, when a file is deleted using the System.IO methods it won't be moved to the Recycle Bin. You have to write specific code to do that.

        Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

        R 1 Reply Last reply
        0
        • R ritu4321

          I am working on a website in asp.net with c#. I need to delete a file which should get completely deleted not even be there in recycle bin . Can anyone help me out in this. :doh: THanks :rose:

          G Offline
          G Offline
          Gandalf_TheWhite
          wrote on last edited by
          #4

          I think u want something like Permanent delete? Once u delete a file then it goes to recycle bin and then it also deleted from recycle bin also?

          Believe Yourself™ :->™

          R 1 Reply Last reply
          0
          • A Abhijit Jana

            From where you want to delete file ???

            Best Regards ----------------- Abhijit Jana View My Latest Article :- SpyNet : Your Network Spy "Success is Journey it's not a destination"

            R Offline
            R Offline
            ritu4321
            wrote on last edited by
            #5

            any folder on c or d drive. anywhere.

            1 Reply Last reply
            0
            • P pmarfleet

              ritu4321 wrote:

              I need to delete a file which should get completely deleted not even be there in recycle bin .

              By default, when a file is deleted using the System.IO methods it won't be moved to the Recycle Bin. You have to write specific code to do that.

              Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

              R Offline
              R Offline
              ritu4321
              wrote on last edited by
              #6

              By default it goes to recycle bin . I need to know how to delete it completely without going into recycle bin.

              1 Reply Last reply
              0
              • G Gandalf_TheWhite

                I think u want something like Permanent delete? Once u delete a file then it goes to recycle bin and then it also deleted from recycle bin also?

                Believe Yourself™ :->™

                R Offline
                R Offline
                ritu4321
                wrote on last edited by
                #7

                ya exactly .

                G 1 Reply Last reply
                0
                • R ritu4321

                  ya exactly .

                  G Offline
                  G Offline
                  Gandalf_TheWhite
                  wrote on last edited by
                  #8

                  1st Can u manage to delete it to the disk level? Means it the deleted file goes to R.Bin? If that is achieved then you have to make some registry level code, Cause it becomes the O.S related Operation. Try to search in Operating System Forum for this 2nd level delete problem. But 1st u have to delete file from 1st level, i.e from drives. Just try the below links for 2nd level deletion http://www.thescripts.com/forum/thread255921.html[^] http://www.developerfusion.co.uk/show/162/[^] i hope this will work.

                  Believe Yourself™ :->™

                  1 Reply Last reply
                  0
                  • R ritu4321

                    I am working on a website in asp.net with c#. I need to delete a file which should get completely deleted not even be there in recycle bin . Can anyone help me out in this. :doh: THanks :rose:

                    S Offline
                    S Offline
                    sirisha guttikonda
                    wrote on last edited by
                    #9

                    Select the file .. shift+delete try this

                    siri

                    1 Reply Last reply
                    0
                    • R ritu4321

                      I am working on a website in asp.net with c#. I need to delete a file which should get completely deleted not even be there in recycle bin . Can anyone help me out in this. :doh: THanks :rose:

                      L Offline
                      L Offline
                      LloydA111
                      wrote on last edited by
                      #10

                      Hiya, It is quiet simple :) My.Computer.FileSystem.DeleteFile("MyFile.txt", FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently) I write this line of code in VB but I'm sure that you will know where to put the funny little bracket things:confused: Hope it was helpful!

                      Lloyd J. Atkinson "Logic will get you from A to B, but imagination will take you everywhere" -ALbert Einstein

                      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