c# - Passing path as arguments -
c# - Passing path as arguments -
i trying pass path string arguments windows form application. understand need add together quotes. using below code.
directoryinfo info = new directoryinfo(path); string.format("\"{0}\"", info.fullname); the code above works when path d:\my development\gitrepositories. when pass c:\ argument c:" because lastly \ character working escape character.
am doing wrong? also, there improve way this?
thanks in advance.
commandlinearg space delimited, hence u need pass command-arg "
which mean if path = c:\my folder\ sent 2 argument, if passed "c:\my folder\" single argument.
so
string commandarg = string.format("\"{0}\"", info.fullname) c# command-line-arguments
Comments
Post a Comment