Most Recent Files Listing

  • Thread starter Thread starter Mr. B
  • Start date Start date
M

Mr. B

In my application which allows a user to open specific AutoCAD script files
(SCR extension), I want to intoduce a listing of the 10 most recently opened
files.

I know of at least two ways that I could do this:
1) Have a text file that contains the information
2) Write the info to the Registry

The first is my easiest as I am familiar with TXT type files. I've never used
(and have no idea how to use) a XML type file (let alone the value or
advantage over a TXT file.

And I've never written anything to the Registry.

So on that note, any thoughts/comments/tips/hints on my best (or suggested
best) way to do this?

And because the file path will be LONG (sometimes over 100 characters) and the
actual files opened could be of the same name, I'll have some creative
thinking on how to list the files... so some tips from others who have similar
issues will be of great assist!

Regards,

Bruce
 
Mr. B said:
In my application which allows a user to open specific AutoCAD script files
(SCR extension), I want to intoduce a listing of the 10 most recently opened
files.

I know of at least two ways that I could do this:
1) Have a text file that contains the information
2) Write the info to the Registry

The first is my easiest as I am familiar with TXT type files.
And I've never written anything to the Registry.

So on that note, any thoughts/comments/tips/hints on my best (or suggested
best) way to do this?

It seems you should go with the method you know best. Not only would it be
a breeze to wire up, but the file would also be accessable to the user. In that way
the first entry could be the number to list, such that the user can easily set that value
there, (As well as some option page in your app). If they want 25 MRU names, then
they can have them....

Just a suggestion!
LFS
 
Mr. B.

When you search in the registry using Regedit to the latest opened project
in your recent file list you will see how Visual Studio does it. Why not do
it the same way.

The registry is easy to handle with VBNet.

http://msdn.microsoft.com/library/d...tml/frlrfmicrosoftwin32registryclasstopic.asp

Why would you do it in another way than Microsoft or making it yourself
difficult with a file which has to be in a certain directory and needs than
extra's to manage that.

The way to do it can be is reading them in an array and every time when
there is a new opened push the oldest down and add the newest in top.

Than when you are closing you write them back as
File1
File2
File3

Etc.

Don't think about time involved with this kind of operations, for a computer
it is almost nothing.

I hope this gives some idea's

Cor
 
Back
Top