编程刷新浏览器页面,从.NET WinForms应用程序 [英] Refresh browser's page programmatically, from a .Net WinForms application

查看:93
本文介绍了编程刷新浏览器页面,从.NET WinForms应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从asp.net页面,通过ClickOnce部署,一个.net WinForms应用程序已启动。
在某一点的WinForm应用程序需要刷新网页它从启动。

From asp.net page, via ClickOnce deployment, a .Net WinForms application is started. At a certain point the WinForm application needs to refresh the web page it was started from.

我怎么能这样做呢?
基于.NET Windows应用程序怎么能刷新在浏览器中已打开一个页面?

How could I do this? How could a .Net based windows application refresh a page that is already opened in a browser?

推荐答案

这是不容易的方式,是强健的事情。用户不得使用以IE为例。

This is not easy to do in a way that is robust. Users may not be using IE, for example.

你唯一控制,这是常见的网页和Windows应用程序是你的Web服务器。

The only thing you control and that is common to the web page and the windows app is your web server.

此解决方案是令人费解的,但我能想到的,将工作的唯一途径。

This solution is convoluted, but is the only way I can think of that would work.

1)获取网页打开窗户应用程序运行之前的长轮询连接到Web服务器。 SignalR此刻获得了良好的preSS这一点。

1) Get the web page to open a long-polling connection to the web server before the windows app runs. SignalR is getting good press for this at the moment.

2)获得Windows应用程序发送一个信号,以当它要更新网页服务器。

2) Get the windows app to send a signal to the server when it wants to update the web page.

3)在服务器上,完成长轮询请求,发送信号回web浏览器。

3) On the server, complete the long-polling request, sending a signal back to the web browser.

4)网页,处理由刷新页面的响应。

4) In the web page, handle the response by refreshing the page.

我说,这是令人费解!

这篇关于编程刷新浏览器页面,从.NET WinForms应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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