如何允许webbrowser在会话过期后重新启动会话? [英] How to allow a webbrowser to restart a session after it has expired?

查看:121
本文介绍了如何允许webbrowser在会话过期后重新启动会话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!


我有一个需要紧急解决的问题。想象一下这个场景:


你有:

1个生产服务器运行Windows Server 2003,IIS6和一个实例

of MSDE 2000 。

有一个运行的asp.net应用程序(用C#编写),它有唯一的

用于呈现带有Next的页面的目的。它上面的按钮和一些状态

信息。当用户单击下一个按钮时,会将事件写入

数据库,并更新并返回状态信息。因此页面

重新加载显示新的状态信息。


有20个远程工作站,每个工作站都有一个触摸屏和

运行自定义应用程序(用Delphi 7.0编写),在主窗体上有一个

嵌入式Web浏览器。 Web浏览器连接到

ASP应用程序并呈现页面。


Web浏览器嵌入另一个应用程序的原因仅仅是因为

应用程序界面公开了之前开发的其他功能。 Web浏览器只是一个加载项。额外的

优势是Delphi应用程序可以加载一个客户端配置

文件来识别工作站:


每个工作站有一个唯一的整数ID(1 - 20),它被添加到TWebBrowser的Navigate()方法的URL上,例如:


var url:string;

..

..

url:=''\\server\asp_app?stationid =''+ IntToStr(stationID);

WebBrowser1.Navigate(url);


asp.net应用程序从请求中读取工作站ID

会话,这个ID链接到每个数据库记录,如上所述。


我的问题是我需要一种方法来传递每个站ID时间

用户点击浏览器中的下一个按钮。我可以使用Session []

键来存储电台ID,但是当会话到期时,这个

信息会丢失。 stationID只能在

初始Delphi应用程序TWebBrowser页面请求中传递,后续点击

下一步按钮与delphi应用程序无关,网页浏览器

孤立地工作。


增加会话超时不是一个解决方案,因为一天或更长时间可能

按钮点击。我需要一种方式来使会话自然地过期,但是当用户点击下一个按钮时,会话

重新打开(或者创建一个新会话,传回站点ID)没有

不得不依靠delphi应用来监控

会话的发生情况。


从根本上说,所需要的是网页本身要记住站点ID,并将其传递回Web服务器。因此,Web服务器

必须以某种方式将站信息添加到页面,当单击按钮时,页面重新提交,并且Web服务器应用程序以某种方式读取

记住的信息。


我该怎么做?我假设按钮本身必须是

runat =" client",一些嵌入式Jscript重新初始化

请求?


和记住的电台ID?我是否需要一个隐藏的字段来存储它?

任何建议都将非常感谢!提前谢谢!


问候,

Riaan

Hi guys!

I have an issue that needs urgent resolution. Imagine this scenario:

You have:
1 production server running Windows Server 2003, IIS6 and an instance
of MSDE 2000.
There is an asp.net app (written in C#) running which has the only
purpose of rendering a page with a "Next" button on it and some status
info. When the user clicks the next button, an event is written to the
database and the status info is updated and returned. The page thus
reloads showing the new status info.

There are twenty remote workstations, each with a touch-screen and
running a custom application (written in Delphi 7.0), which has an
imbedded web browser on the main form. The web browser connects to the
ASP application and renders the page.

The reason the web browser is imbedded in another app is simply because
the application interface exposes other functionality which has been
developed before. The web browser is just an add-in. The additional
advantage is that the Delphi application can load a client-side config
file which identifies the station:

Each workstation has a unique integer ID (1 - 20), which gets added
onto the URL for the TWebBrowser''s Navigate() method, for example:

var url : string;
..
..
url := ''\\server\asp_app?stationid='' + IntToStr(stationID);
WebBrowser1.Navigate(url);

The asp.net app reads the station id from the request to start the
session, this ID is linked to each database record as described above.

My problem is that I need a way to pass along the station ID every time
the user clicks the next button in the browser. I can use the Session[]
keys to store the station ID, but the moment the session expires, this
information is lost. The stationID only gets passed along in the
initial Delphi app TWebBrowser page request, subsequent clicks on the
next button have nothing to do with the delphi app, the web browser
works in isolation.

Increasing the session timeout is not a solution, as a day or more may
go by between next button clicks. I need a way for the session to
expire naturally, but when the user clicks the next button, the session
is reopened (or a new one created, passing back the station id) without
having to rely on the delphi app to monitor what is happening to the
session.

Fundamentally, what is required is for the web page itself to remember
the station ID, and pass it back to the web server. So the web server
must somehow add the station info to the page, and when the button is
clicked, the page is resubmitted, and the web server app somehow reads
the remembered info.

How do I do this? I assume that the button itself will have to be
runat="client", with some imbedded Jscript to re-initialise the
request?

And the remembered station id? Do I need a hidden field to store it?
Any advice would be very much appreciated! Thank you in advance!

Regards,
Riaan

推荐答案

大家好!


我有一个需要紧急解决的问题。想象一下这个场景:

你有:

1个生产服务器运行Windows Server 2003,IIS6和一个实例

的MSDE 2000.

有一个运行的asp.net应用程序(用C#编写),其唯一的目的是渲染一个带有Next的页面。它上面的按钮和一些状态

信息。当用户单击下一个按钮时,会将事件写入

数据库,并更新并返回状态信息。因此页面

重新加载显示新的状态信息。

有20个远程工作站,每个工作站都有一个触摸屏和

运行自定义应用程序(用Delphi 7.0编写),在主窗体上有一个

嵌入式Web浏览器。 Web浏览器连接到

ASP应用程序并呈现页面。

Web浏览器嵌入另一个应用程序的原因仅仅是因为


应用程序界面公开了之前开发的其他功能。 Web浏览器只是一个加载项。额外的

优势是Delphi应用程序可以加载客户端配置

文件来识别工作站:

每个工作站都有一个唯一的整数ID(1 - 20),它被添加到TWebBrowser的Navigate()方法的URL上,例如:

var url:string;

..

..

url:=''http:// server / asp_app?stationid =''+ IntToStr(stationID);

WebBrowser1.Navigate(url);

asp.net应用程序从请求中读取工作站ID以启动

会话,此ID如上所述链接到每个数据库记录。

我的问题是我每次都需要一种方法来传递电台ID


用户点击浏览器中的下一个按钮。我可以使用Session []


键来存储电台ID,但是当会话到期时,这个

信息会丢失。 stationID只能在

初始Delphi应用程序TWebBrowser页面请求中传递,后续点击

下一步按钮与delphi应用程序无关,网页浏览器

孤立地工作。

增加会话超时不是一个解决方案,因为一天或更长时间可能会在下一次按钮点击之间经过
。我需要一种会话方式

自然过期,但当用户点击下一个按钮时,会话


重新打开(或创建一个新会话) ,没有


不得不依赖delphi应用来监控

会话发生的事情。

从根本上说,所需要的是网页本身要记住站点ID,然后将其传回Web服务器。因此,Web服务器

必须以某种方式将站信息添加到页面,当单击按钮时,页面重新提交,并且Web服务器应用程序以某种方式读取

记住的信息。

我该怎么办?我假设按钮本身必须是

runat =" client",有一些嵌入式Jscript重新初始化

请求?

和记得的车站ID?我是否需要一个隐藏的字段来存储它?

任何建议都将非常感谢!提前谢谢!

问候,

Riaan

Hi guys!

I have an issue that needs urgent resolution. Imagine this scenario:
You have:
1 production server running Windows Server 2003, IIS6 and an instance
of MSDE 2000.
There is an asp.net app (written in C#) running which has the only
purpose of rendering a page with a "Next" button on it and some status
info. When the user clicks the next button, an event is written to the
database and the status info is updated and returned. The page thus
reloads showing the new status info.
There are twenty remote workstations, each with a touch-screen and
running a custom application (written in Delphi 7.0), which has an
imbedded web browser on the main form. The web browser connects to the
ASP application and renders the page.
The reason the web browser is imbedded in another app is simply because

the application interface exposes other functionality which has been
developed before. The web browser is just an add-in. The additional
advantage is that the Delphi application can load a client-side config
file which identifies the station:
Each workstation has a unique integer ID (1 - 20), which gets added
onto the URL for the TWebBrowser''s Navigate() method, for example:
var url : string;
..
..
url := ''http://server/asp_app?stationid='' + IntToStr(stationID);
WebBrowser1.Navigate(url);
The asp.net app reads the station id from the request to start the
session, this ID is linked to each database record as described above.
My problem is that I need a way to pass along the station ID every time

the user clicks the next button in the browser. I can use the Session[]

keys to store the station ID, but the moment the session expires, this
information is lost. The stationID only gets passed along in the
initial Delphi app TWebBrowser page request, subsequent clicks on the
next button have nothing to do with the delphi app, the web browser
works in isolation.
Increasing the session timeout is not a solution, as a day or more may
go by between next button clicks. I need a way for the session to
expire naturally, but when the user clicks the next button, the session

is reopened (or a new one created, passing back the station id) without

having to rely on the delphi app to monitor what is happening to the
session.
Fundamentally, what is required is for the web page itself to remember
the station ID, and pass it back to the web server. So the web server
must somehow add the station info to the page, and when the button is
clicked, the page is resubmitted, and the web server app somehow reads
the remembered info.
How do I do this? I assume that the button itself will have to be
runat="client", with some imbedded Jscript to re-initialise the
request?
And the remembered station id? Do I need a hidden field to store it?
Any advice would be very much appreciated! Thank you in advance!
Regards,
Riaan


哦,还有一件事,我必须在cookieless模式下工作。所以cookies

也不是解决方案。

Oh, and another thing, I must work in cookieless mode. so cookies
aren''t a solution either.


按钮当前如何发送表单?它是一个提交按钮吗?


如果表单是服务器表单(例如,有runat =" server"),那么

形式的URL是发布到将与原始URL相同,因此它将在查询字符串中具有

的站ID。


否则你可以将id放入

表单中URL的查询字符串,或者将其放在表单中的隐藏字段中。

Riaan写道:
How does the button currently send the form? Is it a submit button?

If the form is a server form (e.g. has runat="server"), the URL that the
form is posted to will be the same as the original URL, so it will have
the station id in the querystring.

Otherwise you can either put the id in the querystring of the URL in the
form, or put it in a hidden field in the form.
Riaan wrote:
大家好!

我有一个需要紧急解决的问题。想象一下这个场景:

你有:
1台运行Windows Server 2003,IIS6和MSDE 2000实例的生产服务器。
有一个asp.net应用程序(以C#编写)运行,其唯一目的是呈现具有下一步的页面。它上面的按钮和一些状态
信息。当用户单击下一个按钮时,会将事件写入
数据库,并更新并返回状态信息。因此页面重新加载显示新的状态信息。

有20个远程工作站,每个工作站都有一个触摸屏和运行自定义应用程序(用Delphi 7.0编写),在主窗体上有一个嵌入式Web浏览器。 Web浏览器连接到
ASP应用程序并呈现页面。

Web浏览器嵌入另一个应用程序的原因仅仅是因为应用程序界面暴露了其他功能之前已经开发过了。 Web浏览器只是一个加载项。额外的优点是Delphi应用程序可以加载一个标识工作站的客户端配置文件:

每个工作站都有一个唯一的整数ID(1 - 20),它被添加到TWebBrowser的Navigate()方法的URL上,例如:

var url:string;


url:=''\\ server\asp_app?stationid =''+ IntToStr(stationID);
WebBrowser1.Navigate(url);

asp.net应用程序读取从启动
会话的请求中的站ID,这个ID链接到如上所述的每个数据库记录。

我的问题是我需要一种方法来传递每个站ID时间
用户点击浏览器中的下一个按钮。我可以使用Session []
键来存储电台ID,但是当会话到期时,这个信息就会丢失。 stationID只在初始Delphi应用程序TWebBrowser页面请求中传递,后续点击
下一步按钮与delphi应用程序无关,Web浏览器单独工作。增加会话超时不是解决方案,因为在下一次按钮点击之间可能需要一天或更长时间。我需要一种会话方式自然过期,但当用户点击下一个按钮时,会话
重新打开(或创建一个新会话,传回站ID),而不是
必须依靠delphi应用程序来监控
会话发生的事情。

从根本上说,网页本身需要记住的是站点ID,以及将其传递回Web服务器。因此,网络服务器必须以某种方式将电台信息添加到页面中,当点击按钮时,页面将被重新提交,并且Web服务器应用程序会以某种方式读取记住的信息。

我该怎么做?我假设按钮本身必须是运行=客户端,有一些嵌入式Jscript重新初始化
请求?

记住的站点ID?我是否需要一个隐藏的字段来存储它?

任何建议都将非常感谢!提前谢谢!

问候,
Riaan
Hi guys!

I have an issue that needs urgent resolution. Imagine this scenario:

You have:
1 production server running Windows Server 2003, IIS6 and an instance
of MSDE 2000.
There is an asp.net app (written in C#) running which has the only
purpose of rendering a page with a "Next" button on it and some status
info. When the user clicks the next button, an event is written to the
database and the status info is updated and returned. The page thus
reloads showing the new status info.

There are twenty remote workstations, each with a touch-screen and
running a custom application (written in Delphi 7.0), which has an
imbedded web browser on the main form. The web browser connects to the
ASP application and renders the page.

The reason the web browser is imbedded in another app is simply because
the application interface exposes other functionality which has been
developed before. The web browser is just an add-in. The additional
advantage is that the Delphi application can load a client-side config
file which identifies the station:

Each workstation has a unique integer ID (1 - 20), which gets added
onto the URL for the TWebBrowser''s Navigate() method, for example:

var url : string;
.
.
url := ''\\server\asp_app?stationid='' + IntToStr(stationID);
WebBrowser1.Navigate(url);

The asp.net app reads the station id from the request to start the
session, this ID is linked to each database record as described above.

My problem is that I need a way to pass along the station ID every time
the user clicks the next button in the browser. I can use the Session[]
keys to store the station ID, but the moment the session expires, this
information is lost. The stationID only gets passed along in the
initial Delphi app TWebBrowser page request, subsequent clicks on the
next button have nothing to do with the delphi app, the web browser
works in isolation.

Increasing the session timeout is not a solution, as a day or more may
go by between next button clicks. I need a way for the session to
expire naturally, but when the user clicks the next button, the session
is reopened (or a new one created, passing back the station id) without
having to rely on the delphi app to monitor what is happening to the
session.

Fundamentally, what is required is for the web page itself to remember
the station ID, and pass it back to the web server. So the web server
must somehow add the station info to the page, and when the button is
clicked, the page is resubmitted, and the web server app somehow reads
the remembered info.

How do I do this? I assume that the button itself will have to be
runat="client", with some imbedded Jscript to re-initialise the
request?

And the remembered station id? Do I need a hidden field to store it?
Any advice would be very much appreciated! Thank you in advance!

Regards,
Riaan



这篇关于如何允许webbrowser在会话过期后重新启动会话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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