Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Filetime to Date in C#

Posted on 2004-09-01
2
Medium Priority
?
1,869 Views
Last Modified: 2007-12-19
I've got a problem converting Filetime to Date in C#

I'm working with the Win 32 API and with the FtpFindFirstFile which return me ftCreationTime in FileData. I use this type as FileData:
      public class FileData
      {
            public long      fileAttributes = 0;
            public FILETIME ftCreationTime;
            public FILETIME      ftLastAccessTime;
            public FILETIME      ftLastWriteTime;
            public long      nFileSizeHigh = 0;
            public long      nFileSizeLow = 0;
            public long      dwReserved0 = 0;
            public long      dwReserved1 = 0;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst=256)]
            public String      fileName = null;
            [MarshalAs(UnmanagedType.ByValTStr, SizeConst=14)]
            public String      alternateFileName = null;
      }

This works (I think) but now I can't or I don't know how to convert this FILETIME to long (because when it would be long I could use DateTime.FromFileTime())

I already tried to use long or ulong instead of FILETIME but then it returns 0.

Thank you for your help
0
Comment
Question by:SiraX
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
lbertacco earned 2000 total points
ID: 11954734
0
 

Author Comment

by:SiraX
ID: 11956072
Exactly what I need =)

Thank you very much for the quick and right answer
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Screencast - Getting to Know the Pipeline

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question