NinethSense oWnZ mE!: Praveen’s drawing book

Choose a Topic:

Thu
2
Aug '07

Visual SourceSafe Programming

This sample script will list a sourcesafe folder with the name of user who checked out a file

 
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.
'

My New Article - The Accidental Developer

My new article is available at - http://ninethsense.com/content/view/53/59/

This article belongs to Project Management.

I have gone though different kinds of developers during my career. Different skill levels, different technologies, different view ports, different habits. This article is about “How to become a successful developer” for those who are now/going to become a developer from some unexpected accidental situation.
'

Know the KeyCode

To know the KeyCode of key which you pressed in keyboard use e.KeyCode

 
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
    label1.Text = e.KeyCode.ToString();
}


This was useful for me in a kiosk applicaiton development for recognising which keys I must disable.
The CodeProject Microsoft Developer Network Official ASP.NET Forums Microsoft .NET Framework Community Microsoft Most Valuable Professional Kidoos forums Microsoft Visual Studio Developer Home Professional Information Technology Solutions Microsoft Research Home Kerala Microsoft Users Group Community Website