Loupe - Log - Monitor - Resolve
Gibraltar.Data Namespace / FileHelper Class / GetFileLock Method
The full-path file name to create or open.
An action to take on files that exist and do not exist
Desired access to the object, which can be read, write, or both
The sharing mode of an object, which can be read, write, both, or none

In This Topic
    GetFileLock Method
    In This Topic
    Get a persistent lock on a file without opening it.
    Syntax
    'Declaration
     
    
    Public Shared Function GetFileLock( _
       ByVal fileName As String, _
       ByVal creationMode As FileMode, _
       ByVal fileAccess As FileAccess, _
       ByVal fileShare As FileShare _
    ) As FileLock
    public static FileLock GetFileLock( 
       string fileName,
       FileMode creationMode,
       FileAccess fileAccess,
       FileShare fileShare
    )

    Parameters

    fileName
    The full-path file name to create or open.
    creationMode
    An action to take on files that exist and do not exist
    fileAccess
    Desired access to the object, which can be read, write, or both
    fileShare
    The sharing mode of an object, which can be read, write, both, or none
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also