G
Guest
Hi,
How can I access Server and Trace within a helper class?
I have a webform that allows user to select a PDF file (on the web server)
and render a jpeg image of that PDF file. The helper class has a method like
this:
public void ProcessFile(string virtualPath, string outputFilename)
{
Doc theDoc = new Doc();
theDoc.Read(Server.Mappath(virtualPath));
Trace.Write("The virtual path is: ", virtualPath);
theDoc.Rendering.Save(AppDomain.CurrentDomain.BaseDirectory + "image/" +
outputFilename);
}
The problem I have is I'm not sure how I can access Server and Trace within
the helper class.
I tried to replace Server.Mappath with HttpContext.Current.Server.MapPath
but that gave an error on Current too.
Any suggestions?
Thanks,
WB.
How can I access Server and Trace within a helper class?
I have a webform that allows user to select a PDF file (on the web server)
and render a jpeg image of that PDF file. The helper class has a method like
this:
public void ProcessFile(string virtualPath, string outputFilename)
{
Doc theDoc = new Doc();
theDoc.Read(Server.Mappath(virtualPath));
Trace.Write("The virtual path is: ", virtualPath);
theDoc.Rendering.Save(AppDomain.CurrentDomain.BaseDirectory + "image/" +
outputFilename);
}
The problem I have is I'm not sure how I can access Server and Trace within
the helper class.
I tried to replace Server.Mappath with HttpContext.Current.Server.MapPath
but that gave an error on Current too.
Any suggestions?
Thanks,
WB.