IIS7 and up Handler
Posted: Tue Oct 24, 2017 3:52 pm
Hallo
You all know i am still trying to write a web applikation with XSharp.
First: i tried it with CGI like before with VO. MS IIS7 and up is using something like a sandbox and so some importend DLL for the DBF's and so on is not found. There is a workaorund. You have to start a *.cmd file first and this will call the the CGI , then it works.
Now, before i have to make a decision what i will do. i am trying a second way.
Second: Using a ISS7 Handler. After houres i found a example and i was be able to let it run. Now i have to translate it to XSharp and then i wanna write out a DBF file with index, testing if this solution is be able to use the DBF driver.
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.IO;
namespace MyIIS7Project
{
public class MyHandler : IHttpHandler
{
#region IHttpHandler Members
public bool IsReusable
{
get { return true; }
}
public void ProcessRequest(HttpContext context)
{
context.Response.Write(
String.Format("<h1>{0}</h1>",
Directory.GetCurrentDirectory()
));
}
#endregion
}
}
BTW the current durectory is windowssystem32intserv
My Version is:
BEGIN NAMESPACE MyIIS7Project
public class MyHandler inherit IHttpHandler
#region IHttpHandler Members
Method IsReusable () as logic
return true
Method ProcessRequest(context as HttpContext) as void
context:Response:Write("Hallo Welt")
return
end class
#endregion
END NAMESPACE
But i got this error
Fehler XS0535 'MyHandler' does not implement interface member 'IHttpHandler.IsReusable' MyIIS7Project C:UsersBesitzersourcereposMyIIS7ProjectMyIIS7ProjectMyHandler.prg 8
its on the line public class ....
Help
Horst
You all know i am still trying to write a web applikation with XSharp.
First: i tried it with CGI like before with VO. MS IIS7 and up is using something like a sandbox and so some importend DLL for the DBF's and so on is not found. There is a workaorund. You have to start a *.cmd file first and this will call the the CGI , then it works.
Now, before i have to make a decision what i will do. i am trying a second way.
Second: Using a ISS7 Handler. After houres i found a example and i was be able to let it run. Now i have to translate it to XSharp and then i wanna write out a DBF file with index, testing if this solution is be able to use the DBF driver.
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.IO;
namespace MyIIS7Project
{
public class MyHandler : IHttpHandler
{
#region IHttpHandler Members
public bool IsReusable
{
get { return true; }
}
public void ProcessRequest(HttpContext context)
{
context.Response.Write(
String.Format("<h1>{0}</h1>",
Directory.GetCurrentDirectory()
));
}
#endregion
}
}
BTW the current durectory is windowssystem32intserv
My Version is:
BEGIN NAMESPACE MyIIS7Project
public class MyHandler inherit IHttpHandler
#region IHttpHandler Members
Method IsReusable () as logic
return true
Method ProcessRequest(context as HttpContext) as void
context:Response:Write("Hallo Welt")
return
end class
#endregion
END NAMESPACE
But i got this error
Fehler XS0535 'MyHandler' does not implement interface member 'IHttpHandler.IsReusable' MyIIS7Project C:UsersBesitzersourcereposMyIIS7ProjectMyIIS7ProjectMyHandler.prg 8
its on the line public class ....
Help
Horst