(c#) how do i disable the code from configuration file? (the xml.. the .config file)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • halimunan
    New Member
    • Jun 2007
    • 7

    (c#) how do i disable the code from configuration file? (the xml.. the .config file)

    hi all,

    i have this program that will run and the result is based on the .config file.
    how do i disable the code from the config file ?

    for example...

    i want some method to not functioning when i change the variable in the config file..

    e.g:

    my .exe file will copy and delete files at the same time..
    how do i disable the copy function so that the .exe will only delete when i reun the exe file.

    of course i can determine it in the .config file..


    thanks..

    if possible can reply asap!
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    If I understand you correctly, delete the variable from the web.config and add it programmtically . If not please give a clearer explanation. Thank.

    Comment

    • halimunan
      New Member
      • Jun 2007
      • 7

      #3
      erm.. okay, let me give a clearer explanation...

      - my .exe program will run to copy and delete files at the same time.

      - it will copy from folder "a" to folder "b"

      - and then delete some files from both folders

      - the copy and delete depends on the variable which i can determine in the .config file

      - how do make the .exe file "just delete and not copy" ?? which also means that i disable the copyFile codes from the source

      - or is there any other way rather than disabling the copyFile code(which is the only way i`ve been thinking of) ??


      - its actually a backup program which can copy from folder "a" to folder "b" and delete files at whichever folder depending on the days to be retained

      - e.g: it will delete only files that are 5 days old. and that days are configurable in the .config file

      - so how do i make the .exe program running without copying the file.. just deleting the file.. and i should do that in the .config file only..

      - thanks for the help..

      - p/s 1 more thing : i couldnt delete the folders in the folder.. sigh.. it keeps checking the "read only" attributes

      - even after i unchecked it.. can anyony help?

      Comment

      • kenobewan
        Recognized Expert Specialist
        • Dec 2006
        • 4871

        #4
        I was thinking that there was a way to not use the web.config to delete files and do it programmaticall y, but this not you want. There is also deletefile. Anyone else?

        Comment

        Working...