1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

c#.net advance virus

Discussion in 'C#' started by jbp_vicky, Jun 18, 2010.

  1. jbp_vicky

    jbp_vicky New Member

    Joined:
    Aug 29, 2009
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    0
    does anyone know how to delete any specific type of files from the drive like .txt or something else weather it is system file or normal one.I have tried but can't able to delete to system files....so anyway to do this?
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    What code you used for deleting because it should hardly be one statement.
     
  3. jbp_vicky

    jbp_vicky New Member

    Joined:
    Aug 29, 2009
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    0
    the code i am trying is :
    Code:
    
    File.delete(filename);
    
    
    but the problem is it crashed when it encounters system files.and i wanna delete that one also.....
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    You are trying to run an OS command where you do not have the permission to do so and if you can run your process as admin you will be able to do it.

    A programming language cannot get your a command to delete a file even if you do not have the needed permission and so the important thing is not to find that as well. Get to a place where you can have the needed permission.
     
  5. jbp_vicky

    jbp_vicky New Member

    Joined:
    Aug 29, 2009
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    0
    pls help me how can i get the permission?? becoz windows being running will not give me permission any how to delete its own files which is also running.Can u help me by giving solution in coding?
     
  6. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    Admin has all the priviledges.
     

Share This Page