Desktop Functions: Smart Device Functions:
|
FileTime (Structures)
C# Definition:
[StructLayout(LayoutKind.Sequential)] VB.Net Definition:
<StructLayout(LayoutKind.Sequential)> _ Alternative Managed Definition:System.Runtime.InteropServices.FILETIME, or System.Runtime.InteropServices.ComTypes.FILETIME in the .NET Framework 2.0. Notes:None. Sample Code:There is no reason not to use System.Runtime.InteropServices.FILETIME, but there still is a need for conversion to DateTime: C#
public static DateTime FiletimeToDateTime(FILETIME fileTime) { Actually, this is NOT working. The only solution I've found so far is using the API Kernel32.dll function FileTimeToSystemTime, then transforming from that into a regular DateTime. The reason it was not working, is the + operator between "((long) high) << 32" and "low". I changed this to the | operator. This works for me in vb.net:
Private Shared Function ConvertFileTimeToDateTime(input As FILETIME) As DateTime Please edit this page!Do you have...
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed. |
|