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
IIS7 and up Handler
IIS7 and up Handler
Hi Horst,
"IsReusable" is a property, not a method, so you'd need to define int like that:
ACCESS IsReusable AS LOGIC
RETURN TRUE
or, in the more /Net style (completely equivalent) syntax:
PROPERTY IsReusable AS LOGIC
GET
RETURN TRUE
END GET
END PROPERTY
or, like the simplified onliner:
PROPERTY IsReusable AS LOGIC GET TRUE
all the above should do the trick.
Chris
"IsReusable" is a property, not a method, so you'd need to define int like that:
ACCESS IsReusable AS LOGIC
RETURN TRUE
or, in the more /Net style (completely equivalent) syntax:
PROPERTY IsReusable AS LOGIC
GET
RETURN TRUE
END GET
END PROPERTY
or, like the simplified onliner:
PROPERTY IsReusable AS LOGIC GET TRUE
all the above should do the trick.
Chris
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
IIS7 and up Handler
Hi Horst,
could be translated to
and to
But since IHttpHandler is an interface, is the correct one.
Wolfgang
Code: Select all
public class MyHandler : IHttpHandler
Code: Select all
public class MyHandler inherit IHttpHandler
Code: Select all
public class MyHandler implements IHttpHandler
Code: Select all
implements
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it