Web 开发人员可以使用哪种非面向对象语言来创建一次性桌面应用程序?
我正在寻求开发一个 Win32 桌面应用程序 - 一次性的,以满足个人需求。 GUI 并不是严格需要的,尽管它会是一个额外的好处。
需要什么:
- 能够监视特定窗口的窗口标题。
- 当此窗口标题更改时运行 DOS 命令的能力。
我希望我的编程能力能达到这个水平——我觉得我对 PHP 很擅长,但我还没有准备好为这个一次性项目花时间学习 OO。
对于桌面应用程序来说,有哪些非面向对象(或至少不是强制性的面向对象)语言可能适合初学者执行此类任务?
也欢迎任何其他更黑客的方法 - 批处理脚本等。
非常感谢您的任何建议,
杰克
I'm looking to develop a Win32 desktop app - a one off, for a personal need. A GUI is not scrictly needed, though would be a bonus.
What is needed:
- The ability to monitor the window title of a specific window.
- The ability to run DOS commands when this window title changes.
I hope my programming ability is up to this - I feel I'm pretty good with PHP, but I'm not ready to spend time learning OO for this one-off project.
What non OO (or at least not mandatorily OO) languages are there for desktop apps that might be suitable for a beginner on a task like?
Any other, more hacky approaches are welcome too - batch scripts etc.
Many thanks for any advice,
Jack
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
该语言是否支持面向对象对于您的目的来说并不重要。毕竟,PHP 支持对象,而且您似乎用得很好。
就我个人而言,我建议从 Java 或 C# 开始。这两种语言的社区非常庞大,并且有大量在线教程可以帮助您入门。
使用 Visual Studio Express 开始编写 C# 非常容易。还有一个很好的hello world 教程。
另外,如果您坚持使用 C#,则可以利用 WMI 将使您能够完成该项目所需的一切(以及更多)。
最后,大多数 Windows 计算机将能够运行您的应用程序,而无需安装任何额外的东西,并且 Visual Studio 会在构建过程中为您构建 .exe。
Whether or not the language supports OO doesn't really matter for your purposes. After all, PHP supports objects and you seem to do just fine with it.
Personally, i'd recommend Java or C# to get started with. The communities for these two languages are huge and there are plenty of tutorials online to help you get started.
It's extremely easy to get starting writing C# with Visual Studio Express. And a good hello world tutorial.
Also, if you stick with C# you can take advantage of WMI which will allow you to do everything you need for this project (and much much more).
Lastly, most windows machines will be able to run your application without having to install anything extra and Visual Studio builds the .exe for you as part of the build process.
如果您确实愿意,可以将 PHP 用于桌面应用程序。只需安装 php CLI 即可。
你甚至可以用 php 为你的桌面应用程序做一个 GUI: http://gtk.php.net/
编辑:但是,我不确定从 PHP 调用 win32 api 函数有多容易。网上似乎有一些关于此问题的文章和一个问题:如何调用PHP 中的 winapi 函数?
You can use PHP for desktop apps if you really want to. Just install the php CLI.
You can even do a gui for your desktop app in php: http://gtk.php.net/
EDIT: I'm not sure how easily you can call win32 api functions from PHP, however. There look to be a few articles about this online and a SO question: How to call winapi functions from PHP?
我会投票支持 Python 使用包含的 TkInter GUI 模块。使用起来非常简单。
小部件看起来不是最漂亮的,但开发速度很快。
编辑:我将问题中的“non-OO”误认为是“OO”。 Python 绝对不是“非 OO”,但非常适合做你要求的事情。
I would vote for Python using the included TkInter module for GUI. Dead simple to use.
Widgets aren't the prettiest looking, but development is rapid.
EDIT: I mistook "non-OO" in the question for "OO". Python is most definitely not "non-OO", but but is very well suited to doing what you asked.
您可以使用 Windows 支持的几乎任何主流语言来编写此代码。 C 或 C++ 是显而易见的选择。 C# 和 Visual Basic .NET 将需要 .NET Framework……这不是坏事,但可能超出了您想要处理的简单项目的范围。想想看,您也许可以使用 JScript 或 VBScript 来完成此操作,尽管我不清楚您可以轻松访问哪些 API 函数。我必须相信,只需做一点工作就可以使用 PowerShell。
您的选择是敞开的。
You could write this in pretty much any mainstream language supported by Windows. C or C++ are obvious choices. C# and Visual Basic .NET are going to require the .NET Framework ... not a bad thing, but perhaps more than you want to tackle for a simple project. Come to think of it, you might be able to do this with JScript or VBScript, although I'm not clear on what API functions you have easy access to. And I have to believe that it's possible to do with PowerShell with just a little work.
Your options are wide open.
F#
这是一项很棒的工作,可以访问框架类库,支持GUI开发,真正轻松的并行编程,编译为IL(与C#相同),但具有非常简洁的函数语法。
F#
It's an awesome piece of work, has access to the Framework class libraries, supports GUI development, really easy parallel programming, compiles to IL (same as C#) but has a really concise functional syntax.