将Web应用程序加载为Windows桌面应用程序的简单/最佳方式? [英] Simple/Best way to load Web App as Windows Desktop Application?

查看:197
本文介绍了将Web应用程序加载为Windows桌面应用程序的简单/最佳方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我有一个使用html5 / php等构建的web应用程序。它是一个音乐播放器,类似于Spotify和潘多拉。我想分发作为桌面应用程序的网络应用程序,以便人们可以直接从桌面运行它,而无需打开浏览器。我不喜欢像系统这样的浏览器,只是加载了网页视图(类似于在iOS中加载web视图)(没有标签没有网址栏等)



我听说过棱镜,但已停产,我无法在任何地方找到下载链接。
是否有任何建议?



对于Mac Os X,我发现了FluidApp,它似乎在构建独立应用程序时表现出色。



对于iOS而言,我可以简单地通过web视图加载网络应用程序,它工作得很好,正是我需要的。
对于android,我基本上也加载了一个webview。



Windows让我陷入了通过独立桌面应用程序加载webapp的境地。
所以,如果任何人都可以帮助我,它将不胜感激!

解决方案

一个简单的VB.NET应用程序应该能够做到这一点。只需创建一个新的Windows Froms项目,双击表单,将所有内容标记为粘贴:

 公共类Form1 

'##############设置##############'

'更改为您的URL
Dim url As String =http://google.de

'改变窗口标题应该有
的文字Dim title As String =您的标题在这里

'更改为您希望使用的窗口大小
Dim window_size As Size =新大小(800,600)
'^ X ^,^ Y ^
' ###########设置结束##########'

Dim WithEvents WebBrowser1作为新的WebBrowser

Private Sub Form1_Load (sender As Object,e As EventArgs)处理MyBase.Load

Me.Text = title
Me.Size = window_size

Me.Controls.Add(WebBrowser1 )

WebBrowser1.Dock = DockStyle.Fill
WebBrowser1.Navigate(url)

End Sub

Private Sub WebBrowser1_Navigated(sender As Object,e As WebBrowserNavigatedEventArgs)处理WebBrowser1.Navigated

Dim elements As HtmlElementCollection
elements = WebBrowser1.Document.GetElementsByTagName( img)

对于每个元素作为HtmlElement元素
element.SetAttribute(border,0)
下一个
End Sub
End Class

编辑设置并按F5运行。瞧,您应该在桌面应用程序中看到您的WebApp。


Hello basically I have a web app built using html5/php, etc. Its a music player, similar to spotify and pandora. I want to distribute the web app for as a desktop application so people can run it straight from their desktop without opening a browser. I would not like a browser like system, just have the web view loaded (similar to just loading a webview in iOS) (no tabs no url bar, etc)

I heard of Prism but that is discontinued and I can't find a download link anywhere. Is there anything you suggest?

For Mac Os X, i found FluidApp, which seems to work great as it builds a stand alone app.

For iOS I can simply load the web app via a webview and it works great, just what i needed. For android i basically load a webview as well.

Windows just got me stump into loading the webapp via a standalone desktop app. So if anyone could help me out, it will be greatly appreciated!

解决方案

A simple VB.NET application should do the trick. Just create a new Windows Froms project, double click on the form, mark everything an paste this:

Public Class Form1

    '############## Settings ##############'

    'Change to your URL
    Dim url As String = "http://google.de"

    'Change to the text the window title should have
    Dim title As String = "Your Title here"

    'Change to the windows size you wish to use
    Dim window_size As Size = New Size(800, 600)
    '                                  ^X^, ^Y^
    '########### End of Settings ##########'

    Dim WithEvents WebBrowser1 As New WebBrowser

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        Me.Text = title
        Me.Size = window_size

        Me.Controls.Add(WebBrowser1)

        WebBrowser1.Dock = DockStyle.Fill
        WebBrowser1.Navigate(url)

    End Sub

    Private Sub WebBrowser1_Navigated(sender As Object, e As WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated

        Dim elements As HtmlElementCollection
        elements = WebBrowser1.Document.GetElementsByTagName("img")

        For Each element As HtmlElement In elements
            element.SetAttribute("border", "0")
        Next
    End Sub
End Class

Edit the settings and press F5 to run. Voila, you should see you WebApp in a Desktop Application.

这篇关于将Web应用程序加载为Windows桌面应用程序的简单/最佳方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆