473,698 Members | 2,554 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Managing files by Create time/date

I would like to use the timestamp on files to manage the
currency of support files for my VB windows application.
In this case I would only put the timestamp of the file
in the management database and not the file itself.

To do this I will need to have a File class property for
Create time and date that will let me "set" the Create
time and date of the file to my own chooseing.

The VB file class does not appear to have the ability
to "set" the Create time and date. It can only read it.

Is there another system class that will allow me to set
the Create Time and date of a file?
Nov 20 '05 #1
9 3221
> To do this I will need to have a File class property for
Create time and date that will let me "set" the Create
time and date of the file to my own chooseing.
The VB file class does not appear to have the ability
to "set" the Create time and date. It can only read it.


ms-help://MS.VSCC.2003/MS.MSDNQTR.2003 APR.1033

Try
Dim path As String = "c:\Temp\MyTest .txt"

If File.Exists(pat h) = False Then
File.Create(pat h)
Else
' Take an action that will affect the write time.
File.SetLastWri teTime(path, New DateTime(1985, 4, 3))
End If

' Get the creation time of a well-known directory.
Dim dt As DateTime = File.GetLastWri teTime(path)
Console.WriteLi ne("The last write time for this file was {0}.",
dt)

' Update the last write time.
File.SetLastWri teTime(path, DateTime.Now)
dt = File.GetLastWri teTime(path)
Console.WriteLi ne("The last write time for this file was {0}.",
dt)

Catch e As Exception
Console.WriteLi ne("The process failed: {0}", e.ToString())
End Try

Nov 20 '05 #2
How do I reconcile the fact that the user's computer
regional setting for date might be set to
31/2/1959 11:59:59 PM

But Access has the date stored as
2/31/1959 11:59:59 PM

Are they really the same standard format beneath the
covers??

I know this has got to be a old question...but it is a
first time for me.
Nov 20 '05 #3
> How do I reconcile the fact that the user's computer
regional setting for date might be set to
31/2/1959 11:59:59 PM

But Access has the date stored as
2/31/1959 11:59:59 PM

Are they really the same standard format beneath the
covers??


Hi Bob,

No that would not be the case.

What I do when working with SQL is get the time of the SQL Server it is
pulling info from in order to be indpependant of the users clock. In your
case I would find some outside source that you could access that will give
you a time (another server on the internet etc) to compare.
Nov 20 '05 #4
I believe you are looking for the FileInfo class:

http://msdn.microsoft.com/library/de...mberstopic.asp

--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com
"Bob Achgill" <an*******@disc ussions.microso ft.com> wrote in message
news:17******** *************** ******@phx.gbl. ..
I would like to use the timestamp on files to manage the
currency of support files for my VB windows application.
In this case I would only put the timestamp of the file
in the management database and not the file itself.

To do this I will need to have a File class property for
Create time and date that will let me "set" the Create
time and date of the file to my own chooseing.

The VB file class does not appear to have the ability
to "set" the Create time and date. It can only read it.

Is there another system class that will allow me to set
the Create Time and date of a file?

Nov 20 '05 #5
My question is about the order of the time/date pieces...

On one users computer he may have set his month to be
first and the day second

But in my Access data base I have the reversed...

so when I try to use the file info to check the Create
time or set the Create time I am apples and oranges
different between how the data base is talking time and
date and the Access data base is talking time and date.

Does it matter that the user has a different regional
setting for the order of time and date? Is that just
formatting as it appears to the eye of the user AND
beneath the covers the time and date appear the same
between the Access data base and the Windows operating
system??
-----Original Message-----
How do I reconcile the fact that the user's computer
regional setting for date might be set to
31/2/1959 11:59:59 PM

But Access has the date stored as
2/31/1959 11:59:59 PM

Are they really the same standard format beneath the
covers??
Hi Bob,

No that would not be the case.

What I do when working with SQL is get the time of the

SQL Server it ispulling info from in order to be indpependant of the users clock. In yourcase I would find some outside source that you could access that will giveyou a time (another server on the internet etc) to compare.

.

Nov 20 '05 #6
Bob,

Time formats do matter. If you have a different date formats you will need
to create code that can convert between any of the time formats used in your
update process. This conversion code will be used anywhere you need to
create, stamp, read, and compare dates coming from and going to different
formats.

Regional time differences must be considered. One approach to dealing with
time stamps accross time regions is to use coordinated universal time (UTC).
UTC can be used convert time on the server and time from a remote client to
UTC so you can make an apples to apples comparrison.

To update the user - are you pushing table rows to a table in a remote
user's copy of the Access database you have on the server? Or are you
pushing a new database (mdb) to them? If neither of these questions is true
what type of file are you keeping up on the remote client?

I ask because there are other approaches to keeping the remote client in
sync that do not involve working with a file's DateTime. I may be able to
provide directions for a simpler and more stable approach.
--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com

"Bob Achgill" <an*******@disc ussions.microso ft.com> wrote in message
news:17******** *************** ******@phx.gbl. ..
My question is about the order of the time/date pieces...

On one users computer he may have set his month to be
first and the day second

But in my Access data base I have the reversed...

so when I try to use the file info to check the Create
time or set the Create time I am apples and oranges
different between how the data base is talking time and
date and the Access data base is talking time and date.

Does it matter that the user has a different regional
setting for the order of time and date? Is that just
formatting as it appears to the eye of the user AND
beneath the covers the time and date appear the same
between the Access data base and the Windows operating
system??
-----Original Message-----
How do I reconcile the fact that the user's computer
regional setting for date might be set to
31/2/1959 11:59:59 PM

But Access has the date stored as
2/31/1959 11:59:59 PM

Are they really the same standard format beneath the
covers??


Hi Bob,

No that would not be the case.

What I do when working with SQL is get the time of the

SQL Server it is
pulling info from in order to be indpependant of the

users clock. In your
case I would find some outside source that you could

access that will give
you a time (another server on the internet etc) to

compare.


.

Nov 20 '05 #7
Hi Mike,

Thank you for your advice.

We are making a free program that will run on Pentium 1
class computer with 16MB video card.

It will help illiterate people to learn to read their
native language.

The reading program is in VB .Net

As the student reads text in a WebBrowser window with in
the VB program it looks in the local database for each
word meaning and shows the associated Flash animation for
that word meaning to help the student understand the
meaning of the word. We also show an associated 3D
animation of the hand sign for that word meaning. We
pass this info from the VB .Net program to our C++
program that shows the hand sign.

Our users (in a 3rd world country) will probably
initially have someone hand them a CD that has the
starting programs+mdb+an imation files for the language
they are working on learning to read. Let's say one
language will be about
1,800 - Flash animations ( 5 - 30 K each)
1,800 - 3D vector sign files (1-3K each)
mdb - with lexicon and pointers to Flash and sign
files (1MB)

As you can imagine such a system will have a lot of
updates as volunteers add or revise new animations and
hand signs. So we will give the capability to "phone
home" and receive updates if the user has internet
access.

We can use either use pulling rows from a server as an
option to do this and or FTP. The files could either be
packed in the rows and unpacked or straight FTP to the
client disk. If they are straight FTP then hence I need
to have Create Time stamps to determine version of the
files to be replaced on the client machine. If we go the
row transfer method for moving the files then I don't
need to rely on file time stamps.

Any advice on how to make this simpler is much
appreciated!

Bob
-----Original Message-----
Bob,

Time formats do matter. If you have a different date formats you will needto create code that can convert between any of the time formats used in yourupdate process. This conversion code will be used anywhere you need tocreate, stamp, read, and compare dates coming from and going to differentformats.

Regional time differences must be considered. One approach to dealing withtime stamps accross time regions is to use coordinated universal time (UTC).UTC can be used convert time on the server and time from a remote client toUTC so you can make an apples to apples comparrison.

To update the user - are you pushing table rows to a table in a remoteuser's copy of the Access database you have on the server? Or are youpushing a new database (mdb) to them? If neither of these questions is truewhat type of file are you keeping up on the remote client?
I ask because there are other approaches to keeping the remote client insync that do not involve working with a file's DateTime. I may be able toprovide directions for a simpler and more stable approach.

--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com

"Bob Achgill" <an*******@disc ussions.microso ft.com> wrote in messagenews:17******* *************** *******@phx.gbl ...
My question is about the order of the time/date pieces...
On one users computer he may have set his month to be
first and the day second

But in my Access data base I have the reversed...

so when I try to use the file info to check the Create
time or set the Create time I am apples and oranges
different between how the data base is talking time and
date and the Access data base is talking time and date.

Does it matter that the user has a different regional
setting for the order of time and date? Is that just
formatting as it appears to the eye of the user AND
beneath the covers the time and date appear the same
between the Access data base and the Windows operating
system??
>-----Original Message-----
>> How do I reconcile the fact that the user's computer
>> regional setting for date might be set to
>> 31/2/1959 11:59:59 PM
>>
>> But Access has the date stored as
>> 2/31/1959 11:59:59 PM
>>
>> Are they really the same standard format beneath the
>> covers??
>
>Hi Bob,
>
>No that would not be the case.
>
>What I do when working with SQL is get the time of the

SQL Server it is
>pulling info from in order to be indpependant of the

users clock. In your
>case I would find some outside source that you could

access that will give
>you a time (another server on the internet etc) to

compare.
>
>
>.
>

.

Nov 20 '05 #8
Bob,

If you wish I am willing to donate some free time to help you work up the
best synchronization approach for this project.

By taking the time to explain the project in your latest email, you have
given me enough to see at least four ways to accomplish synchronization , all
of which I have implemented in real-world projects.

If you would like to take advantage of my offer please contact me at
mi****@getdotne tcode.com. Ideally we could talk on the phone for 15-30
minutes and nail down enough specifics for me to prepare a written
recommendation and some example code.

If you do not want to go in this direction I will answer your latest post
directly here in the newsgroup.

Regards,
--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com

"Bob Achgill" <an*******@disc ussions.microso ft.com> wrote in message
news:17******** *************** ******@phx.gbl. ..
Hi Mike,

Thank you for your advice.

We are making a free program that will run on Pentium 1
class computer with 16MB video card.

It will help illiterate people to learn to read their
native language.

The reading program is in VB .Net

As the student reads text in a WebBrowser window with in
the VB program it looks in the local database for each
word meaning and shows the associated Flash animation for
that word meaning to help the student understand the
meaning of the word. We also show an associated 3D
animation of the hand sign for that word meaning. We
pass this info from the VB .Net program to our C++
program that shows the hand sign.

Our users (in a 3rd world country) will probably
initially have someone hand them a CD that has the
starting programs+mdb+an imation files for the language
they are working on learning to read. Let's say one
language will be about
1,800 - Flash animations ( 5 - 30 K each)
1,800 - 3D vector sign files (1-3K each)
mdb - with lexicon and pointers to Flash and sign
files (1MB)

As you can imagine such a system will have a lot of
updates as volunteers add or revise new animations and
hand signs. So we will give the capability to "phone
home" and receive updates if the user has internet
access.

We can use either use pulling rows from a server as an
option to do this and or FTP. The files could either be
packed in the rows and unpacked or straight FTP to the
client disk. If they are straight FTP then hence I need
to have Create Time stamps to determine version of the
files to be replaced on the client machine. If we go the
row transfer method for moving the files then I don't
need to rely on file time stamps.

Any advice on how to make this simpler is much
appreciated!

Bob
-----Original Message-----
Bob,

Time formats do matter. If you have a different date

formats you will need
to create code that can convert between any of the time

formats used in your
update process. This conversion code will be used

anywhere you need to
create, stamp, read, and compare dates coming from and

going to different
formats.

Regional time differences must be considered. One

approach to dealing with
time stamps accross time regions is to use coordinated

universal time (UTC).
UTC can be used convert time on the server and time from

a remote client to
UTC so you can make an apples to apples comparrison.

To update the user - are you pushing table rows to a

table in a remote
user's copy of the Access database you have on the

server? Or are you
pushing a new database (mdb) to them? If neither of

these questions is true
what type of file are you keeping up on the remote

client?

I ask because there are other approaches to keeping the

remote client in
sync that do not involve working with a file's DateTime.

I may be able to
provide directions for a simpler and more stable

approach.


--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com

"Bob Achgill" <an*******@disc ussions.microso ft.com>

wrote in message
news:17******* *************** *******@phx.gbl ...
My question is about the order of the time/date pieces...
On one users computer he may have set his month to be
first and the day second

But in my Access data base I have the reversed...

so when I try to use the file info to check the Create
time or set the Create time I am apples and oranges
different between how the data base is talking time and
date and the Access data base is talking time and date.

Does it matter that the user has a different regional
setting for the order of time and date? Is that just
formatting as it appears to the eye of the user AND
beneath the covers the time and date appear the same
between the Access data base and the Windows operating
system??

>-----Original Message-----
>> How do I reconcile the fact that the user's computer
>> regional setting for date might be set to
>> 31/2/1959 11:59:59 PM
>>
>> But Access has the date stored as
>> 2/31/1959 11:59:59 PM
>>
>> Are they really the same standard format beneath the
>> covers??
>
>Hi Bob,
>
>No that would not be the case.
>
>What I do when working with SQL is get the time of the
SQL Server it is
>pulling info from in order to be indpependant of the
users clock. In your
>case I would find some outside source that you could
access that will give
>you a time (another server on the internet etc) to
compare.
>
>
>.
>

.

Nov 20 '05 #9
Thank you.

I will write you.

Bob
-----Original Message-----
Bob,

If you wish I am willing to donate some free time to help you work up thebest synchronization approach for this project.

By taking the time to explain the project in your latest email, you havegiven me enough to see at least four ways to accomplish synchronization , allof which I have implemented in real-world projects.

If you would like to take advantage of my offer please contact me atmi****@getdotn etcode.com. Ideally we could talk on the phone for 15-30minutes and nail down enough specifics for me to prepare a writtenrecommendati on and some example code.

If you do not want to go in this direction I will answer your latest postdirectly here in the newsgroup.

Regards,
--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com

Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1666
by: Eliezer Figueroa | last post by:
Managing Multiple Excel incoming files? I have this situation. I have a client which have several locations they work primary with excel forms and they are thinking in doing reports with them. What they want is to import those Excel files into SQL Server for later using crystal reports or maybe asp.net for reporting. Those files will come every week from diferent locations then go to SQL Server and then they should be stored in a folder...
21
4832
by: dub | last post by:
Hello web folks... I've been desigining web pages for 13 years using my trusty text editor (UltraEdit) and in depth knowledge of HTML. I'm truly a text editor ninja at this point. I am frequently using regular expressions to search and replace in multiple files. I also use many different copy buffers and know all the keyboard shortcuts like the back of my hand. The point is... it's comfortable. Unfortunately, it's become just too...
7
3614
by: tgh003 | last post by:
I would be interested to hear how others are managing their javascript (.js) files from the original code vs the obfuscated version they publish to their site/webapp. I currently manage 2 files, and everytime i need to make a change, I have to switch the names, test, then rename again, obfuscate to the original file name (because this is the file referenced in php/perl/asp whatever files). So its kind of a pain. Any thoughts out...
9
9705
by: John J. Hughes II | last post by:
Is it possible using Image or Bitmap to build and save an animated GIF file? I am not have a problem saving the GIF file just getting the frames added to it. I did find ImageAnimator but it only seems to deal with showing the GIF and not saving it. Thanks, John
9
2261
by: Chris Pearl | last post by:
Are there Python tools to help webmasters manage static websites? I'm talking about regenerating an entire static website - all the HTML files in their appropriate directories and sub-directories. Each page has some fixed parts (navigation menu, header, footer) and some changing parts (body content, though in specific cases the normally fixed parts might change as well). The tool should help to keep site editing DRY every piece of data,...
1
11132
by: Screenbert | last post by:
After finding nothing anywhere in google I am posting this so everyone can benefit by it. The formating is not pretty since I copied it from my word document, but you should benefit by it. Managing DHCP Servers using C# They said it was impossible. It couldn't be done. But you can in fact manage DHCP servers using C#. This includes creating and deleting Scopes, SuperScopes, Reservations, Exclusions, Options and so forth. Since the dll...
0
12353
by: screenbert | last post by:
Managing DHCP Servers using C# They said it was impossible. It couldn't be done. But you can in fact manage DHCP servers using C#. This includes creating and deleting Scopes, SuperScopes, Reservations, Exclusions, Options and so forth. Since the dll that is used was written several years ago by Microsoft, you cannot manage things on the DNS tab when looking at a reservation and few things such as that however it gives you main things you...
4
2531
by: jonathan184 | last post by:
Hi I have a perl script, basically what it is suppose to do is check a folder with files. Now the files are checked using a timestamp with the command ls -l so the timestamp in this format is checked. Now what the script does is it checks the time stamp and creates a year folder if it does not exist and then creates a month folder if it does not exist and puts the respective files in the month folders. If the files are created this month then it...
1
2045
by: Madhu Harchandani | last post by:
Hello i am working in a project in which i am using xnat technology in that data is entered through xml files only i need to enter 1000 records .so it is very cumbersome to create 1000 xml files So i need a simple way so that i can create and insert 1000 records in xnat database this is the xml file which i want to generate again and again with some different values Plz could someone helps me get over this problem ...
0
8685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9171
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.