Checking If File Is In Use
IsFileInUse will return true if the file is locked for exclusive access. It would fail if the file doesn't exist at all.
~~~~~~~~~~~~~~~~~~~~~~~~~ function IsFileInUse(fName : string) : boolean; var HFileRes : HFILE; begin Result := false; if not FileExists(fName) then exit; HFileRes := CreateFile(pchar(fName), GENERIC_READ or GENERIC_WRITE, 0, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) ; Result := (HFileRes = INVALID_HANDLE_VALUE) ; if not Result then CloseHandle ~~~~~~~~~~~~~~~~~~~~~~~~~
Delphi tips navigator: » Capture Maximize/Minimize Buttons « Rotating text
|
uses wininet
if not InternetCheckConnection(PChar(CUrl), 1, 0) then
Begin
ShowMessage('网路不通!');
Exit;
End;
分享到:
相关推荐
Note: the stl vector is used in this assignment, if you have any difficulties, you can refer to the documents given in this folder. Submission Submit only the following. 1. hashset.cpp – your ...
if 表示将判断是否符合规定的条件,从而决定执行不同的命令。有三种格式: 1、if "参数" == "字符串" 待执行的命令 参数如果等于指定的字符串,则条件成立,运行命令,否则运行下一句。(注意是两个等号) 如if "%1...
.htaccess isn't difficult to use and is really just made up of a few simple instructions in a text file. 从本指南中,你将可以学习到有关.htaccess文件及其功能的知识,并用以优化你的网站。尽管....
- If a file does not extend beyond any of the original limitations (filesizes of 4 gig or 65535 files) then no Zip64 format information is included in the archive. - property isZip64 - tells you when ...
great only if you know how to use it properly; otherwise, you are not much better off than someone with a hammer. LINQ is powerful. Powerful beyond measure. I hope you will see some of that power by ...
Note: the stl vector is used in this assignment, if you have any difficulties, you can refer to the documents given in this folder. Submission Submit only the following. 1. hashset.cpp – your ...
in a log file. - Updated license management, in an attempt to remove a rare crash on startup. Release 5.3 build 1012.0002 WIN32 release 31 October 2007 - New build of Rebooter (64-bit Windows ...
Note: If you use a symbol Foo in your source file, you should bring in a definition for Foo yourself, either via an #include or via a forward declaration. Do not depend on the symbol being brought in ...
The simple style can be enabled by following steps: open the file “Settings.ini” under the programme folder (this file can be created manually if there is no such file under the folder); change the...
SQUASHFS 2.2 - A squashed read-only filesystem for Linux ... Released under the GPL licence (version 2 or later). Welcome to Squashfs version ... If an exclude file/directory is absolute (i.e. prefixed...
If you are just checking availability and do not require the full whois details then you can speed up the function call with some domain extensions by setting $details="*"; before calling cWhois. If...
This disables checking if symlink targets are in subtree. Symlink target pointers will be converted regardlessly. If you convert multiple hundredthousands or millions of files the memory usage of ...
Splitting a page when full is simple and does not require a tree traversal for node overflow checking as in a b+tree. Main page list updates are infrequent and hence the locking of the main page list...
Fix-Path.zip This is used to fix a filenames path<END><br>28 , Password-Finder.zip This will help you find you lost Microsoft Access 97 password<END><br>29 , fileexist.zip Checking file ...
If the class is not confident in their understanding, review appendix A04_Locking and its accompanying PowerPoint® file. Transactions in SQL Server provide the ACID properties: Atomicity A ...
This is a simple tool to help pinpoint performance bottlenecks in individual Android Lint checks. It uses Java byte code instrumentation to collect and report performance statistics per detector for a...
-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master) -drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i] [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off] [,cache=...
Subsequent access times are essentially instantaneous, until either all of the 128 palette states are in use, or the palette is cleared via the VsClearPalette() command. The VsIsReady() function can...
If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and ...
The side effect for this is that YOUR app must check if the host is a host name or a IP address, in my app I remove the periods and try to convert the result to a float (long integers don‘t work, ...