开发者

how to call php functions from .NET WPF application?

开发者 https://www.devze.com 2022-12-18 04:38 出处:网络
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 app

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号