2016-07-06 1 views
0

Vault Client API 기능을 사용하여 .NET Winforms 애플리케이션을 개발 한 것은 처음입니다. 볼트 클라이언트 API를 사용하여 프로젝트 당 라벨 목록을 가져오고 싶습니다.프로젝트의 사용 가능한 레이블을 어떻게 나열합니까?

VaultClientIntegrationLib.dll에서 ServerOperations.ProcessCommandFindLabels() 메소드가 발견되었지만 성공적인 결과를 얻으려면 매개 변수가 어떻게 나타나는지 실마리가 없습니다.

도움을 주시면 감사하겠습니다.

답변

1

많은 시도 끝에 아래 코드를 실행하여 프로젝트의 모든 레이블을 얻을 수 있습니다.

나는 내가 다음 코드를 추가 한

using VaultLib; 
using VaultClientIntegrationLib; 

(수업 시간에) 두 개의 DLL의 (VaultLib.dll 및 VaultClientIntegrationLib.dll) 비주얼 스튜디오 프로젝트에서 참조 아래 및 추가 2 using 문을 추가 정적 방법

ServerOperations.client.LoginOptions.URL = url; 
ServerOperations.client.LoginOptions.User = user; 
ServerOperations.client.LoginOptions.Password = pass; 
ServerOperations.client.LoginOptions.Repository = rep; 
ServerOperations.Login(); 
ServerOperations.client.AutoCommit = true; 

string prjPath = "$/projectpath"; 
VaultLabelItemX[] arLabelItems = null; 

int nRetCode = ServerOperations.ProcessCommandFindLabels("*", prjPath, false, 1000, true, true, VaultFindInFilesDefine.PatternMatch.Wildcard, out arLabelItems); 

MessageBox.Show(arLabelItems.Count().ToString()); // Print how much labels found 

foreach (var item in arLabelItems) 
{ 
    MessageBox.Show(arLabelItems[i].Label.ToString()); // Show Label 
} 
관련 문제