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

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -