将 HTML + JavaScript 转换为 exe

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16584589/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 08:25:56  来源:igfitidea点击:

Converting HTML + JavaScript to an exe

javascripthtmlexecutable

提问by Eilidh

There is actually a topic asking a very similar thing, however the information there is either out of date (broken links, discontinued solutions) or not suitable for my needs.

实际上有一个主题问了一个非常相似的事情,但是那里的信息要么过时(断开的链接,停止的解决方案)要么不适合我的需要。

I have a showcase for my graduation wherein we have the opportunity to display our work to potential employers. The interface we have to use only allows .jpg, .flv and .exe files, however my project is in HTML / CSS / JavaScript.

我有一个毕业展,在那里我们有机会向潜在雇主展示我们的工作。我们必须使用的界面只允许 .jpg、.flv 和 .exe 文件,但是我的项目是 HTML/CSS/JavaScript。

Is there any way I can convert my project into a .exe?

有什么方法可以将我的项目转换为 .exe 吗?

(The ways the pre-existing question's answers suggest creating an .exe are now broken links / discontinued as far as I can tell; and alternate answers suggest ways to create standalone applications which do not generate .exes, which are not fit for my purposes)

(就我所知,预先存在的问题的答案建议创建 .exe 的方式现在已断开链接/已停止使用;替代答案建议创建不生成 .exe 的独立应用程序的方法,这些应用程序不适合我的目的)

Cheers!

干杯!

采纳答案by Rajender Joshi

Most easiest way is:

最简单的方法是:

1) Download Visual Studio Express Edition(Because it's free).

1) 下载Visual Studio Express Edition(因为它是免费的)。

2) File -> New Project -> Windows Forms Application.

2) 文件 -> 新建项目 -> Windows 窗体应用程序。

3) Load your current HTML into it.

3)将您当前的 HTML 加载到其中

4) Add WebBrowser controlto your project.

4) 将WebBrowser 控件添加到您的项目中。

5) Deploy your application(Build -> Publish).

5) 部署您的应用程序(构建 -> 发布)。

Note: The WebBrowser Control use IE by-default. Take a look at this alternativeas well.

注意:WebBrowser 控件默认使用 IE。也看看这个替代方案

回答by AzureBlueRaven

YouCould always turn the HTML file into a HTA file and then convert it into an exe :)

可以随时将 HTML 文件转换为 HTA 文件,然后将其转换为 exe :)

http://www.scriptcode.com/vbscripteditor/

http://www.scriptcode.com/vbscripteditor/

回答by mwilson

Welcome to 2019!

欢迎来到 2019 年!

There's all kinds of different ways to accomplish this now. One popular npm package is npm pkg. There's also the popular Electron(this is what vscode was built on), and quite a few others

现在有各种不同的方法来实现这一点。一种流行的 npm 包是npm pkg。还有流行的Electron(这是构建 vscode 的基础),还有很多其他的