コマンド ラインから UploadAndScan アクションを呼び出すときに通常渡すものは、多かれ少なかれ次のようになります。
VeracodeC#API.exe -action uploadandscan -appname appName -version version -createprofile true -filepath filePath -vuser ユーザー名 -vpassword パスワード
したがって、コードを機能させるには、次のように変更する必要があります。
using System;
using System.Reflection;
using com.veracode.apiwrapper;
namespace ConsoleApplication3
{
using System;
{
static void Main()
{
//----------------------------------------------------------
String appName = "enter-application-name-here";
String version = "enter-version-here";
bool createProfile = true;//or false;
String filePath = "enter-filepath-here";//ie: "C:\\file.exe"
String username = "enter-username-here";
String password = "enter-password-here";
//----------------------------------------------------------
//String[] args = <the same args that you pass when you call the UploadAndScan composite action>;
String[] args = new String[]
{
"-action", "uploadandscan",
"-appname", appName,
"-version", version,
"-createprofile", createProfile.ToString(),
"-filepath", filePath,
"-vuser", username,
"-vpassword", password
};
Type t = System.Reflection.Assembly.GetAssembly(typeof(AbstractAPIWrapper)).GetType("com.veracode.apiwrapper.cli.VeracodeCommand");
MethodInfo m = t.GetMethod("Main", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public);
m.Invoke(null, new Object[] { args });
Console.Read();
}
}
}