how to call php functions from .NET WPF application?
So I'm going to build a simple PHP CMS. I need to know how should I build it to be able to call its functions from .NET WPF applicationm and how to call PHP functions and send forms from WPF .NET application...
BTW: I'm goin开发者_如何学Cg to have users with passwords that would need some form of authentication, after which they'll need to call that functions
So how to call PHP functions from .NET WPF application?
If I understand your question correctly you would simply have your WPF application request your PHP script just like any other web page. Send your post/get vars to the PHP app, have it run the necessary operations, and then whatever PHP 'prints' to the screen should be captured by WPF for processing.
You will just need to be sure that the PHP scripts are web accessible. If you want to get really fancy with it you could open a socket between WPF and PHP for continuous communication, but your CMS model will really dictate whether or not that is necessary.
Why not go the MVC-url approach:
mysite.com/function-name/[param1/][param2/][param3/]...
So calling mysite.com/getRegDate/2332
would call:
function getRegDate($userid) {
return "2009-01-01"; // logic to get date
}
Returning the date-text in the response.
精彩评论