简体   繁体   中英

Finding absolute path to website from a Windows service or desktop app

I have a Windows service and a desktop app that is located on the same machine as my website but is not part of the site's directory. Is there a way to determine the absolute path of the website from the service or desktop app?

I came across this post: ServerManager How to get site's physical path on disk?

but three people commented that the ServerManager has some serious memory leaks, so I'm looking for a better solution.

假设服务和应用程序都知道网站的URL,只需在网站上由aspx驱动的页面上以XML输出绝对网络和本地路径,然后在应用程序或服务中读取XML。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM