c# - ProcessStartInfo WorkigDirectory parameter -


i have web application in want execute .exe file.

 processstartinfo info = new processstartinfo();  info.workingdirectory = this.workingdirectory; 

when put

info.workingdirecoty = request.mappath("~"); info.filename = server.mappath("~/thefile.exe"); 

it works. when put them this:

info.workingdirecoty = "~"; info.filename = "~/thefile.exe"; 

it doesnt work, why ?? , how can solve problem ?? or should use server.mappath???

as msdn says

server.mappath method

the mappath method maps specified relative or virtual path corresponding physical directory on server.

and need give direct file path processstartinfo should use server.mappath in case

if don't want use server.mappath because of reference system.web can create basedir property in library class, , pass out world have reference it.

hope helps.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

c# - SharpSVN - How to get the previous revision? -

php cli reading files and how to fix it? -