How to access the HttpServerUtility.MapPath method in a Thread or Timer?

前端 未结 6 1877
梦毁少年i
梦毁少年i 2020-12-23 15:46

I use a System.Timers.Timer in my Asp.Net application and I need to use the HttpServerUtility.MapPath method which seems to be only available via <

6条回答
  •  囚心锁ツ
    2020-12-23 16:18

    Can you not call the MapPath function before starting the timer, and simply cache the result? Is it absolutely neccessary to have the MapPath call inside the tick event?

提交回复
热议问题