2008-11-07 57 views

回答

1

您可以使用自动化,VSS 6.0(及更早版本)附带可用的ActiveX dll。 参考项目中的Microsoft SourceSafe 6.0 Type Library以及类似于(未经证实和未经测试的VB代码)应该适用于您。

自动化功能非常强大,我曾经用它来证明Vss集成到Ide中。我曾经建立了业务类型民间编写XQuery片断来查询Xml消息的地方。

Private Sub GetAllVersionNumbers() 
    Dim db As New VSSDatabase 
    Call db.Open("\\codestore\myProject\srcsafe.ini", "Myuser", "password") 

    Call GetItemVersion(db.CurrentProject) 
End Sub 

Private Sub GetItemVersion(ByVal root As VSSItem) 
    Dim item As VSSItem 

    For Each item In root 
     If item.Type = VSSITEM_FILE Then 
      Call Output(item.Name, item.VersionNumber) 
     Else ' item.Type =VSSITEM_FDOLDER 
      'recurse 
      Call GetItemVersion(item) 
     End If 
    Next 
End Sub 
相关问题