开发者

how to get the path for executable file that started the application?

开发者 https://www.devze.com 2022-12-19 13:47 出处:网络
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(Applica

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号