How do I find the application path in an HttpModule timer?
public class Module : IHttpModule
{
public void Init(HttpApplication application)
{
timer = new Timer(new TimerCallback(this.myMethod),
application.Context, TimeSpan.Zero, new TimeSpan(0, 15, 0));
}
static Timer timer;
private void myMethod(object sender)
{
// this works the first time, but not on subsequent calls
string path = ((HttpContext)sender).Request.ApplicationPath;
}
public void Dispose()
{
timer.Dispose();
}
}