![]() |
|
[.NET] [VB.NET]FileAccessible - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] [VB.NET]FileAccessible (/showthread.php?tid=397072) |
[VB.NET]FileAccessible - codepoet - May 1, 2010 originally posted on dotnet-snippets.com Description: This function checks if a given file is in use by opening the file with exclusive read/write permissions. If the file is in use this function wont get exclusive permissions and will throw an exception and the function will return "true", otherwise you'll get "false" Code Public Function FileInUse(ByVal sFile As String) As BooleanIf You Like this tutorial, please check out my other tutorials by clicking ==> H3R3 * - Zer0Fact0r - May 1, 2010 Just for future reference, FileAccessible would be a better suited name for this function since it will also return true if your application is not allowed to access sFile. * - codepoet - May 2, 2010 (May 1, 2010 09:08 PM)Zer0Fact0r Wrote: Just for future reference, FileAccessible would be a better suited name for this function since it will also return true if your application is not allowed to access sFile. ok renamed it |