Új hozzászólás Aktív témák

  • ArchElf

    addikt

    válasz Des1gnR #3179 üzenetére

    Ötletek:
    1. Használj ""-t filterezésre, lehet, hogy a "*" csak a kiterjesztés nélküli fájlokat figyeli.
    To watch for changes in all files, set the Filter property to an empty string ("") or use wildcards ("*.*"). To watch a specific file, set the Filter property to the file name. For example, to watch for changes in the file MyDoc.txt, set the Filter property to "MyDoc.txt". You can also watch for changes in a certain type of file. For example, to watch for changes in text files, set the Filter property to "*.txt".
    2. lehet, hogy explicit Security Permission kell a metódusnak:
    [PermissionSet(SecurityAction.Demand, Name="FullTrust")]

    3. WaitForChanged
    This method waits indefinitely until the first change occurs and then returns. This is the same as using WaitForChanged with the timeout parameter set to -1.
    Egyrészt ez a metódus addig vár, amíg nincs változás (tehát a program "megáll, amíg nem történik valami). Másrészt amikor visszatér az első változással, akkor tovább fut a program (te viszont nem is nézed, mi a változás). Azután beállítod a figyelést és a események generálását, de mivel nincs, ami "visszatartaná" (loop vagy readkey, vagy akármi), így a programot ezzel ki is lép...

    AE

Új hozzászólás Aktív témák