/// <summary> /// vss check in命令 /// </summary> /// <param name="localFilePath">本地文件路径</param> /// <param name="vssFilePath">vss上的文件路径</param> /// <param name="comment">checkin注释</param> public void CheckIn(string localFilePath, string vssFilePath, string comment) { vssFilePath = this.FormatToVssDir(vssFilePath); localFilePath = this.FormatToLocalDir(localFilePath); //string testFile = "$/TestFolder/test.txt"; // Create a VSSDatabase object. IVSSDatabase vssDatabase = new VSSDatabase(); // Open a VSS database using network name // for automatic user login. vssDatabase.Open(this.srcSafeIni, this.username, this.password); IVSSItem vssFile = vssDatabase.get_VSSItem(vssFilePath, false); //vssFile.Checkout("Checkout comment", @"C:\1\test.txt", 0); //if ((VSSFileStatus)vssFile.IsCheckedOut == // VSSFileStatus.VSSFILE_NOTCHECKEDOUT) // Console.WriteLine(vssFile.Spec + " is checked in."); //else // Console.WriteLine(vssFile.Spec + " is checked out."); //Console.WriteLine("Now alter the file and hit any key."); //Console.ReadLine(); vssFile.Checkin(comment, localFilePath, 0); if ((VSSFileStatus)vssFile.IsCheckedOut == VSSFileStatus.VSSFILE_NOTCHECKEDOUT) { Console.WriteLine(vssFile.Spec + " is checked in."); } else { Console.WriteLine(vssFile.Spec + " is checked out."); } }