Thu
2
Aug '07
This sample script will list a sourcesafe folder with the name of user who checked out a file
Note that this is just a sample and this will show only single folder. Make it rescursive to show sub folders also.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.VisualStudio.SourceSafe.Interop;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
VSSDatabase db = new VSSDatabase();
db.Open(@“\Machine1\vssfolder\srcsafe.ini”,“praveen”,“praveen”);
VSSItem folder = db.get_VSSItem(“$/myproject”, false);
IVSSItems items = folder.get_Items(false);
foreach (VSSItem item in items)
{
if (item.Type == 1) // files
{
string chkuser = string.Empty;
foreach (VSSCheckout checkout in item.Checkouts)
{
chkuser = ” ======>>>[” + checkout.Username + “] “;
}
listBox1.Items.Add(item.Name + chkuser);
}
}
}
}
}
Note that this is just a sample and this will show only single folder. Make it rescursive to show sub folders also.

Leave a passing comment »