Most Recent Files Listing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mr. B

    Most Recent Files Listing

    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
  • Larry Serflaten

    #2
    Re: Most Recent Files Listing


    "Mr. B" <User@NoWhere.c om> wrote[color=blue]
    > 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.[/color]
    <...>[color=blue]
    > 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?[/color]

    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

    Comment

    • Cor Ligthert

      #3
      Re: Most Recent Files Listing

      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.



      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


      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: Most Recent Files Listing

        "Mr. B" <User@NoWhere.c om> schrieb:[color=blue]
        > 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.[/color]

        Add Most Recently Used Files (MRU) List to Windows Applications
        <URL:http://www.codeproject .com/csharp/mru.asp>

        --
        M S Herfried K. Wagner
        M V P <URL:http://dotnet.mvps.org/>
        V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


        Comment

        Working...