Καλώς ορίσατε στο dotNETZone.gr - Σύνδεση | Εγγραφή | Βοήθεια
σε

 

Αρχική σελίδα Ιστολόγια Συζητήσεις Εκθέσεις Φωτογραφιών Αρχειοθήκες

User Rights

Îåêßíçóå áðü ôï ìÝëïò Firebrand. Τελευταία δημοσίευση από το μέλος Firebrand στις 27-10-2010, 10:36. Υπάρχουν 2 απαντήσεις.
Ταξινόμηση Δημοσιεύσεων: Προηγούμενο Επόμενο
  •  26-10-2010, 15:16 60679

    User Rights

    Γεια χαρά σε όλους.

    Πως μπορώ με κώδικα VB.net να βάλω user rights (Everyone και Full Control σε ένα folder)

     

    Ευχαριστώ.

  •  27-10-2010, 00:27 60684 σε απάντηση της 60679

    Απ: User Rights

    Αν και δεν το προτείνω (γιατί κάτι τέτοια βλέπουν οι IT Pros και μας κράζουν)

    Dim sid As New Security.Principal.SecurityIdentifier("S-1-1-0") 'sid για Everyone

     

    Dim acnt As System.Security.Principal.NTAccount = CType(sid.Translate(GetType(System.Security.Principal.NTAccount)), System.Security.Principal.NTAccount)

     

    Dim newRule As New Security.AccessControl.FileSystemAccessRule(acnt, Security.AccessControl.FileSystemRights.FullControl, Security.AccessControl.AccessControlType.Allow)

    Dim dir As String = "C:\Test"

     

    Dim dirSec As System.Security.AccessControl.DirectorySecurity = New System.Security.AccessControl.DirectorySecurity(dir, Security.AccessControl.AccessControlSections.All)

    dirSec.AddAccessRule(newRule)


    Don't try to argue with the machine
    Elias Markelis
    MCPD,MCT
  •  27-10-2010, 10:36 60685 σε απάντηση της 60684

    Απ: User Rights

    Thanx a lot!

Προβολή Τροφοδοσίας RSS με μορφή XML
Με χρήση του Community Server (Commercial Edition), από την Telligent Systems