@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The GetFileSizeEx API !!!!C# Signature: [DllImport("kernel32.dll")] static extern bool GetFileSizeEx(IntPtr hFile, out long lpFileSize); !!!!VB.Net Signature: <DllImport("kernel32.dll",CharSet:=CharSet.Auto)> _ Public Shared Function GetFileSizeEx( _ <[In]()> ByVal hFile As IntPtr, _ <[In](), Out()> ByRef lpFileSize As Long) As Boolean !!!!User-Defined Types: None. !!!!Notes: None. !!!!Tips & Tricks: Please add some! !!!!Sample Code: C# IntPtr handle = CreateFile( PathString, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, 0); //PInvoked too if (handle.ToInt32() == -1) { return; } long fileSize; bool result = GetFileSizeEx(handle, out fileSize); if (!result) { return; } !!!!Alternative Managed API: class System.IO.FileInfo, member Length. Documentation: GetFileSizeEx@msdn on MSDN
Edit kernel32.getfilesize
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.