/// <summary> /// /// </summary> /// <param name="vssFilePath"></param> /// <param name="localPath"></param> /// <param name="comment"></param> public void UndoCheckOut(string vssFilePath, string comment) { vssFilePath = this.FormatToVssDir(vssFilePath); IVSSDatabase vssDatabase = new VSSDatabase(); vssDatabase.Open(this.srcSafeIni, this.username, this.password); IVSSItem vssFile = vssDatabase.get_VSSItem(vssFilePath, false); //只有取消自己检出的 if ((VSSFileStatus)vssFile.IsCheckedOut == VSSFileStatus.VSSFILE_CHECKEDOUT_ME) { vssFile.UndoCheckout(); Console.WriteLine("undo check out ." + vssFilePath); } Console.ReadLine(); }