添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge static void Lock(int FileNumber);
public static void Lock (int FileNumber);
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("macos")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public static void Lock (int FileNumber);
static member Lock : int -> unit
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("macos")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
static member Lock : int -> unit
Public Sub Lock (FileNumber As Integer)

Parameters

Examples

This example illustrates the use of the Lock and Unlock functions. This example assumes that People.txt is a file that contains records of the structure Person .

Structure Person
    Dim Name As String
    Dim ID As Integer
End Structure
Sub PutInLockedFile(ByVal onePerson As Person)
    FileOpen(1, "c:\people.txt", OpenMode.Binary)
    Lock(1)
    FilePut(1, onePerson)
    Unlock(1)
    FileClose(1)
End Sub
    	

Remarks

The Lock and Unlock functions are used in environments where several processes might need access to the same file.

Lock and Unlock functions are always used in pairs. The arguments to Lock and Unlock must be identical.

If Record, or FromRecord and ToRecord are not supplied, the lock will be for the whole file. If Record alone is specified the single record will be locked/unlocked.

If the file has been opened for sequential input or output, Lock and Unlock affect the whole file, regardless of the range specified by FromRecord andToRecord.

public:
 static void Lock(int FileNumber, long Record);
public static void Lock (int FileNumber, long Record);
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("macos")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public static void Lock (int FileNumber, long Record);
static member Lock : int * int64 -> unit
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("macos")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
static member Lock : int * int64 -> unit
Public Sub Lock (FileNumber As Integer, Record As Long)

Parameters

Examples

This example illustrates the use of the Lock and Unlock functions. This example assumes that People.txt is a file that contains records of the structure Person.

Structure Person
    Dim Name As String
    Dim ID As Integer
End Structure
Sub PutInLockedFile(ByVal onePerson As Person)
    FileOpen(1, "c:\people.txt", OpenMode.Binary)
    Lock(1)
    FilePut(1, onePerson)
    Unlock(1)
    FileClose(1)
End Sub
    	

Remarks

The Lock and Unlock functions are used in environments where several processes might need access to the same file.

Lock and Unlock functions are always used in pairs. The arguments to Lock and Unlock must be identical.

If Record, or FromRecord and ToRecord are not supplied, the lock will be for the whole file. If Record alone is specified the single record will be locked/unlocked.

If the file has been opened for sequential input or output, Lock and Unlock affect the whole file, regardless of the range specified by FromRecord andToRecord.

public:
 static void Lock(int FileNumber, long FromRecord, long ToRecord);
public static void Lock (int FileNumber, long FromRecord, long ToRecord);
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("macos")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public static void Lock (int FileNumber, long FromRecord, long ToRecord);
static member Lock : int * int64 * int64 -> unit
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("macos")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
static member Lock : int * int64 * int64 -> unit
Public Sub Lock (FileNumber As Integer, FromRecord As Long, ToRecord As Long)

Parameters

Examples

This example illustrates the use of the Lock and Unlock functions. This example assumes that People.txt is a file that contains records of the structure Person.

Structure Person
    Dim Name As String
    Dim ID As Integer
End Structure
Sub PutInLockedFile(ByVal onePerson As Person)
    FileOpen(1, "c:\people.txt", OpenMode.Binary)
    Lock(1)
    FilePut(1, onePerson)
    Unlock(1)
    FileClose(1)
End Sub
    	

Remarks

The Lock and Unlock functions are used in environments where several processes might need access to the same file.

Lock and Unlock functions are always used in pairs. The arguments to Lock and Unlock must be identical.

If Record, or FromRecord and ToRecord are not supplied, the lock will be for the whole file. If Record alone is specified the single record will be locked/unlocked.

If the file has been opened for sequential input or output, Lock and Unlock affect the whole file, regardless of the range specified by FromRecord andToRecord.

Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback.

Submit and view feedback for

This product