locked
Search Files & Metadata in a VSS Database using VSS Automation RRS feed

  • Question

  • Hi All:

    How can we Search Files & their metadata in a specific VSS Repository (6.0 / 2005) using VSS Automation.

    Eg:

    a. I would like to search all files named "Reusable" in a VSS Repository. 

    b. I would like to search all files which are of a type .xls in a VSS Repository. 

    Thank You



    DAVID




    • Edited by David_7 Friday, November 2, 2012 4:19 AM
    Thursday, November 1, 2012 3:50 PM

Answers

  • Recursive traversal all items in VSS DB via VSS automation APIs, such as:

        
        using Microsoft.VisualStudio.SourceSafe.Interop;
        
        
        VSSDatabase vssDatabase = new VSSDatabase();
        vssDatabase.Open(@"X:\VSSDB\srcsafe.ini", userName, password);
        IVSSItem vssFolder = vssDatabase.get_VSSItem("$", false);
        GetItem(vssFolder);
          
        ...
        static void GetItem(IVSSItem item)
        {
          if (item.Type != 0)
          {
            // Check the name of item
            return;
          }
          foreach (IVSSItem i in item.get_Items())
            GetItem(i);
        }


    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us

    Friday, November 2, 2012 4:49 AM
    Moderator

All replies

  • Recursive traversal all items in VSS DB via VSS automation APIs, such as:

        
        using Microsoft.VisualStudio.SourceSafe.Interop;
        
        
        VSSDatabase vssDatabase = new VSSDatabase();
        vssDatabase.Open(@"X:\VSSDB\srcsafe.ini", userName, password);
        IVSSItem vssFolder = vssDatabase.get_VSSItem("$", false);
        GetItem(vssFolder);
          
        ...
        static void GetItem(IVSSItem item)
        {
          if (item.Type != 0)
          {
            // Check the name of item
            return;
          }
          foreach (IVSSItem i in item.get_Items())
            GetItem(i);
        }


    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us

    Friday, November 2, 2012 4:49 AM
    Moderator
  • Hi Bob, Thanks a lot!

    DAVID

    Friday, November 2, 2012 4:54 AM