[DllImport("kernel32.dll", SetLastError=true)] static extern int LockFile ( int hFile, int dwFileOffsetLow, int dwFileOffsetHigh, int nNumberOfBytesToLockLow, int nNumberOfBytesToLockHigh); [DllImport("kernel32.dll", SetLastError=true)] static extern int UnlockFile ( int hFile, int dwFileOffsetLow, int dwFileOffsetHigh, int nNumberOfBytesToUnlockLow, int nNumberOfBytesToUnlockHigh) ;
[DllImport("kernel32.dll", SetLastError=true)] static extern int LockFile ( int hFile, int dwFileOffsetLow, int dwFileOffsetHigh, int nNumberOfBytesToLockLow, int nNumberOfBytesToLockHigh);
[DllImport("kernel32.dll", SetLastError=true)] static extern int UnlockFile ( int hFile, int dwFileOffsetLow, int dwFileOffsetHigh, int nNumberOfBytesToUnlockLow, int nNumberOfBytesToUnlockHigh) ;
如果很大的读lock
读的程序,创建时捕捉异常即可。