我已经阅读了VeraCode应用编程接口包装器文档的详细信息。我遵循了与“从Visual Studio引用Veracode API包装器”相关的所有步骤。
根据这些步骤,我能够创建UploadAPIWrapper类的一个实例,如下所述:
UploadAPIWrapper uploadWrapper =新的var ();
我能够看到包装器可以执行的所有简单操作,如下所述:

我还可以在命令提示符中看到复合操作uploadandscan,如下面的屏幕截图所示:

但无法看到包装器可以执行的复合操作,如uploadandscan。
有没有人可以在这里给我提个建议,以防我遗漏了任何先决条件。
感谢和问候,Santosh Kumar Patro
发布于 2013-12-28 03:49:36
当您从命令行调用UploadAndScan操作时,通常传递的内容大致如下所示:
VeracodeC#API.exe -action上传和扫描-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();
}
}}
https://stackoverflow.com/questions/20787839
复制相似问题