c# - Limit of startupeventargs.args array? -
i have 14 arguments being passed through command line. first 1 seems cut off reason , isn't reaching startupeventargs.args.
what size of startupeventargs e string array?
protected override void onstartup(startupeventargs e) { parsearguments(e.args); } private static void parsearguments(string[] args) { //args[args.length + 1] = "-sn"; log.write("parsing {0} arguments...", args.length); // parse command line arguments (int = 1; < args.length; i++) { //test log.write(args[i]); switch (args[i - 1]) { case "-sn": // parse show name showname = args[i]; break; //...
edit: called app written in c++:
sprintf(szcommandline, "-sn %n -sd %s -w %d -h %d -t %d -l %d -th %d", szwebshow, szbasedir, iwidth, iheight, itop, ileft, threadid); if(createprocess(playweb_exe,szcommandline, null, null, false, detached_process, null, null, &startinfo, &procinfo)) { log(logstr("web show started: %s ", szcommandline));
command line: (path .exe) -sn "m000018\33.9999-2815-8-ws001" -sd c:\player\shows2 -w 1280 -h 720 -t 0 -l 0 th 1
arrays in c# 0 based, docs:
c# arrays 0 indexed; is, array indexes start @ zero
the array index needs start @ 0:
for (int = 0; < args.length; i++) { //.....
edit
now have added explanation of how calling process, can see have issue it. docs on createprocess
function, second parameter command line and:
if both lpapplicationname , lpcommandline non-null, null-terminated string pointed lpapplicationname specifies module execute, , null-terminated string pointed lpcommandline specifies command line.
what should doing this:
createprocess(null, szcommandline....)
where szcommandline
has executable prefix, example playweb_exe -sn blah... etc
Comments
Post a Comment