2016-07-06 11 views
0

初めてVault Client API機能を使用して.NET Winformsアプリケーションを開発しました。 Vault Client APIを使用して、プロジェクトごとのラベルのリストを取得したいとします。プロジェクトの利用可能なラベルを一覧表示するにはどうすればよいですか?

VaultClientIntegrationLib.dllのServerOperations.ProcessCommandFindLabels()メソッドが見つかりましたが、成功した結果を得るにはどのようにパラメータを設定する必要があるかわかりません。

何か助けていただければ幸いです。

答えて

1

多くの試みの後、以下のコードを実行してプロジェクトのすべてのラベルを取得できます。

は、私は次のコードを追加しました

using VaultLib; 
using VaultClientIntegrationLib; 

(クラスの)2 DLLの(VaultLib.dllとVaultClientIntegrationLib.dll)のVisual Studioプロジェクトでの参照の下、コメントを追加しました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 
} 
関連する問題