开发者

C# window rendering PHP

开发者 https://www.devze.com 2023-01-22 10:18 出处:网络
I want to build an application written in C# that renders a webpage in a dialog. Simple enough there are lots of tutorials on how to do this

I want to build an application written in C# that renders a webpage in a dialog. Simple enough there are lots of tutorials on how to do this http://www.codeproject.com/KB/cs/webbrowser.aspx

Now I want to render some PHP pages instead of static pages, mainly to configure a database (SQLIte) and a开发者_开发问答dd a few recored, ect. I don't want to have to run a separate webs server just for PHP

I was surprised when I could not find any PHP extension in CSharp.

Suggestions on how I can accomplish this?


You can run the PHP CLI (command line interface) executable and use the output of this to display this in the web browser control. This is by far the easiest way to accomplish what you're looking for.

This executable is included in the download from PHP at http://windows.php.net/download/.

You can also try to communicate with the PHP DLL through interop, but this will be a lot more work.


You can connect to a SQLite database directly from C#. There is no need to have any PHP in your application at all. If your pages are simple I'd try porting the PHP to C# rather than having two separate systems.

From your brief description it doesn't sound like the PHP is doing anything too complicated so it probably won't take long to rewrite it in C# and the end result will be a cleaner solution that is easier to maintain.

Related

  • Is there a .NET/C# wrapper for SQLite?
0

精彩评论

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