T
Tom Clement
using System.Text;
using System.Runtime.InteropServices;
[DllImport("Shlwapi.dll", CharSet = CharSet.Auto)]
public static extern long StrFormatByteSize( long fileSize,
[MarshalAs(UnmanagedType.LPTStr)] StringBuilder buffer, int bufferSize );
public static string StrFormatByteSize(long fileSize)
{
StringBuilder sbBuffer = new StringBuilder(20);
StrFormatByteSize(fileSize, sbBuffer, 20);
return sbBuffer.ToString();
}
(Posted since I didn't find this on my Deja search)
www.apptero.com
using System.Runtime.InteropServices;
[DllImport("Shlwapi.dll", CharSet = CharSet.Auto)]
public static extern long StrFormatByteSize( long fileSize,
[MarshalAs(UnmanagedType.LPTStr)] StringBuilder buffer, int bufferSize );
public static string StrFormatByteSize(long fileSize)
{
StringBuilder sbBuffer = new StringBuilder(20);
StrFormatByteSize(fileSize, sbBuffer, 20);
return sbBuffer.ToString();
}
(Posted since I didn't find this on my Deja search)
www.apptero.com