是否有类似 JS 的语言允许对本地文件进行写访问?
我想编写一个小程序,让我使用表单来更新一些本地文件。
我可以通过将它们设为 json 来读取它们,但是 JS 不允许我写入本地文件。
我一直在 Perl 中执行此操作,但它没有方便输入的 GUI(除了尝试使用一些 Tkx 组装)
是否有一种语言可以让我既使用 GUI 又可以编写本地文件(并且支持哈希值和正则表达式)?
I want to write a little program that will let me use a form to update some local files.
I can read them by making them json, but JS won't let me write local files.
I do this in Perl all the time, but it doesn't have a GUI for convenient input (short of trying to use some Tkx kludge)
Is there a language which will let me both use a GUI and write local files (and which supports hashes and regexs)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
JavaScript将允许您编写本地文件,但您无法在基于浏览器的 JavaScript 中执行此操作。以 node.js 为例,读写文件没有问题。因此,结合一些 HTML、客户端 JavaScript、Ajax 和“服务器端”(在同一台机器上运行)JavaScript 来完成您需要做的事情。
至于一种允许您使用 GUI、允许文件访问并支持哈希和正则表达式的语言……这几乎是所有其他主流语言。我个人会推荐 Visual Basic.NET。
JavaScript will let you write local files, you just can't do it in browser-based JavaScript. Take node.js for example, you can read and write files no problem. So combine some HTML, client-side JavaScript, Ajax and "server-side" (run on the same machine) JavaScript to do what you need to do.
As for a language that lets you use a GUI, allows file access, and supports hashes and regular expressions... that's pretty much every other mainstream language. I personally would recommend Visual Basic.NET.
如果你想要 Perl 和 JS GUI,为什么不直接使用呢?使用 Perl 代码作为 CGI 脚本运行本地 Web 服务器,并通过基于浏览器的前端连接到它。 Apache 可在 Linux 和 Windows 上运行,并且安装起来非常简单。只需确保使用一些现代的 Perl Web 框架,而不是一些古老的框架来简化您的开发。
If you want Perl with JS GUI, why not have just that? Run a local web server with Perl code as a CGI script, and connect to it via a browser based front-end. Apache runs on both Linux and Windows and is a breeze to install. Just make sure to use some modern Perl web frameworks and not something ancient to ease your development.
我相信谷歌新的 dart 语言(语法介于 js 和 java 之间(主要是 js),嵌入浏览器等)可以做到这一点。我也只是阅读 关于这个。从来没有亲自尝试过。
I believe that google new dart language (with between js to java in syntax (mostly js), browser embedded etc) can do that. also I just read about that here. never tried It by myself.
如果您的 GUI 是基于 Windows 的,请尝试 Microsoft 的 .NET 框架。您可以在几分钟内获得一个运行 Visual Basic 或 C# 代码的简单 GUI。当然它可以写入本地文件系统。
If your GUI is Windows-based, try Microsoft's .NET framework. You can get a simple GUI with Visual Basic or C# code running in a couple minutes. And of course it can write to the local file system.