windows - vb.net creating an application that can be called by arguments -
i'm creating addin application autodesk inventor. addin has purpose have designtools increase productivity.
(this tool in particular perform copy design info.)
i have written tool in standalone application , worked, added autodesk inventor addin , didn't work anymore.
so searched around bit , found should keep standalone application , call addin.
this call addin i'm doing think, there bunch of methods on msdn page but, guess need
sub openwitharguments() ' url's not considered documents. can opened ' passing them arguments. process.start("iexplore.exe", "www.northwindtraders.com") ' start web page using browser associated .html , .asp files. process.start("iexplore.exe", "c:\mypath\myfile.htm") process.start("iexplore.exe", "c:\mypath\myfile.asp") end sub 'openwitharguments
but how create copydesign.exe can accept arguments when call it?
you have 2 options (that know of) :
option 1
use main method argument.
somewhere in code there main method, i.e. first method called when application starts. should :
sub main() ... end sub
you can decide method should receive arguments :
sub main(byval cmdargs() string) each arg string in cmdargs 'do stuff arg debug.writeline("argument : " & arg) next end sub
option 2
use commanline property of environment
sub main() dim arguments string() = environment.getcommandlineargs() each arg string in arguments 'do stuff arg debug.writeline("argument : " & arg) next end sub
edit
be aware first argument receive path executable... have 1 more argument needed...
Comments
Post a Comment