Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Any chance to get the file creation/modification date?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-26-2008, 09:49 AM
Newbie
 
Join Date: Feb 2008
Posts: 6
Default Any chance to get the file creation/modification date?

Is there any DLL to get the date/time a file was created/modified?I have to compare wich one is the newer file.
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 11:03 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,770
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Have a play with this. See if it does what you need?

EDIT :- the dates and times are a string. In case it is not obvious get the ticks value by :-
Code:
  Dim dt(2) ' in globals

  ...

  DateFormat = "dd/mm/yyyy" ' for those of us for whom the defaults fail
  TimeFormat = "hh:mm:ss"
  dt() = StrSplit(info(4)," ")
  d = DateParse(dt(0)) + TimeParse(dt(1)) Mod cTicksperday
  '  "mod" because the current date is included by TimeParse
Attached Files
File Type: zip FilesEx1.0.zip (2.2 KB, 22 views)

Last edited by agraham : 02-26-2008 at 11:49 AM.
Reply With Quote
  #3 (permalink)  
Old 02-26-2008, 03:14 PM
Newbie
 
Join Date: Feb 2008
Posts: 6
Default

WOW, thats GREAT!

Exactly what i need!

Easy, small but powerfull!

Thanks!
Reply With Quote
  #4 (permalink)  
Old 02-26-2008, 03:33 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,770
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

For registered users I have posted an expanded version together with a help file in the "Additional libraries" forum.
Reply With Quote
  #5 (permalink)  
Old 03-06-2008, 08:04 AM
Newbie
 
Join Date: Feb 2008
Posts: 6
Default

I just tried to read the file info of the program that is running to have an auto version number by this.
But i always get an unsupported error-message.

Is there no chance to read the file info of the program that uses this .dll?

It would be great if this would be possible.


Sub Globals
Dim info(5)
End Sub

Sub App_Start
Form1.Show
FilesEx1.New1
info() = FilesEx1.FileInfo("DateTest.exe")
Label1.Text = "Version " & SubString(info(2),6,4)-2007 &"."& Int(SubString(info(2),3,2))&"."& Int(SubString(info(2),0,2))
End Sub


The program is called DateTest.exe, so it has to read its own info.

Last edited by Christian72DD : 03-06-2008 at 08:15 AM.
Reply With Quote
  #6 (permalink)  
Old 03-06-2008, 09:15 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,770
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by Christian72DD View Post
Is there no chance to read the file info of the program that uses this .dll?
There is no problem in doing this.

If it is not finding the file try

info() = FilesEx1.FileInfo(AppPath & "\DateTest.exe")

If that still doesn't work check the actual strings returned with a msgbox() before trying to build your version string to check the formatting. The strings may be differently formatted between device and desktop.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error During Program modification mozaharul Questions & Help Needed 2 07-24-2008 07:38 AM
C# Custom control creation Cableguy Questions & Help Needed 2 05-19-2008 02:04 PM
Experience with creation of HELP files HARRY Questions & Help Needed 3 02-27-2008 02:58 PM
Speed of dynamic control creation willisgt Questions & Help Needed 4 12-05-2007 02:52 PM
How to get saved date and time value or other properties of a file? Rioven Questions & Help Needed 1 08-30-2007 07:10 AM


All times are GMT. The time now is 04:23 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0