469,609 Members | 1,657 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

Duplicate dates

I have been trying to fig out how to build up an array with dates. When its
generated i want to be able to remove duplicate dates. The dates is
generated by FileInfo object that is scanning a folder for files.
Here is some code for that. In this case i am only using a variable not an
array.

_info = new FileInfo(_fileName);
base.Text = _info.LastWriteTime.ToShortDateString();

As i see it i must first generate the array with dates. Then create another
array an put the values from array 1 into it one by one. I tested with
StringCollection object. But i'm stuck. I kant fig out how to do it. Are
there someone that have some code that can show me how to remove duplicate
dates from my array?

Best regards
Trond
Nov 16 '05 #1
2 1297

Why not check the array first before inserting a duplicate? If you are
using a hashtable you can use the .Contains() method to see if the item is
already there.


Trond wrote:
I have been trying to fig out how to build up an array with dates. When
its generated i want to be able to remove duplicate dates. The dates is
generated by FileInfo object that is scanning a folder for files.
Here is some code for that. In this case i am only using a variable not an
array.

_info = new FileInfo(_fileName);
base.Text = _info.LastWriteTime.ToShortDateString();

As i see it i must first generate the array with dates. Then create
another array an put the values from array 1 into it one by one. I tested
with StringCollection object. But i'm stuck. I kant fig out how to do it.
Are there someone that have some code that can show me how to remove
duplicate dates from my array?

Best regards
Trond


Nov 16 '05 #2
Thank you. I will try that. Would be fantastic if you added some code to
that comment, in case you have some. It is always easyer to learn by viewing
some code :-)
Best regards
Trond
"Dummy Here" <du*****@keepthespam.com> wrote in message
news:u0****************@TK2MSFTNGP15.phx.gbl...

Why not check the array first before inserting a duplicate? If you are
using a hashtable you can use the .Contains() method to see if the item is
already there.


Trond wrote:
I have been trying to fig out how to build up an array with dates. When
its generated i want to be able to remove duplicate dates. The dates is
generated by FileInfo object that is scanning a folder for files.
Here is some code for that. In this case i am only using a variable not
an
array.

_info = new FileInfo(_fileName);
base.Text = _info.LastWriteTime.ToShortDateString();

As i see it i must first generate the array with dates. Then create
another array an put the values from array 1 into it one by one. I tested
with StringCollection object. But i'm stuck. I kant fig out how to do it.
Are there someone that have some code that can show me how to remove
duplicate dates from my array?

Best regards
Trond


Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Giloosh | last post: by
5 posts views Thread by rob | last post: by
9 posts views Thread by rjshrader | last post: by
reply views Thread by Solution2021 | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.