Connect to VSS with C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I'm trying to write an application in C# to download automatically files
from my VSS server to a local directory.

I want to use the login message box provided by VSS so the user will choose
the correct VSS database and writes the user and password. Do you know if it
is possible to do so or it is better to create my own form to connect to VSS
?

Thank you,
Hafa.
 
I dont know if you can do that. I tried using tlbimp on ssgui.dll (in the
VSS install dir) and it failed. My best guess is you have to access the
dialog from this dll. However its very easy to create one of your own and
mimic the functionality since VSS automation exposes all needed information.
To connect to a vss db, you may use the following code (add ref to
Microsoft.VisualStudio.SourceSafe.Interop assembly):
Microsoft.VisualStudio.SourceSafe.Interop.VSSDatabaseClass s = new
VSSDatabaseClass();
try
{
s.Open(@"C:\SourceSafeProjects\srcsafe.ini", "Admin", "");
}
catch (Exception)
{
}
replacing hardcoded strings with your own vars.
HTH
Ashish
 
Back
Top