how to get the path for executable file that started the application?
i am working on a web application using C开发者_如何学Go#,
i know that in window application how to give the path for executable file that started the application (if (!System.IO.File.Exists(Application.StartupPath + "\gsdll32.dll")))
but i dont know how to give that path in web application using c#
please help me .
In ASP.NET you use the MapPath method:
var siteRootPath = Server.MapPath("~/");
Yet another possibility is to use the ApplicationPhysicalPath static property:
var path = HostingEnvironment.ApplicationPhysicalPath;
First thing you cannot run your executable from client end. It has to be a server side code which would run on server and for this you can use the similar logic.
精彩评论