线程和会话对象 [英] Threading and Session Objects

查看:82
本文介绍了线程和会话对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在做一个asp.net应用程序,它在客户端和我的Intranet上的服务器之间上传和下载文件和

文件夹。要做到这一点,我有

创建线程,它运行正常,但我需要向用户显示

操作的进度,这就是问题所在。我尝试从线程内部访问会话

变量,以便在自动刷新的页面上显示它,但是我发现没有访问权限httpcontext

来自新线程内部。还有其他办法吗?


非常感谢。


-

RobertoLópez

Dpto。 Soporte Software

EurosistemasInformáticosyComunicaciones,SL

Hi,
I′m doing an asp.net application that uploads and downloads files and
folders between the client and the server on my intranet. To do this I have
create threads and it runs Ok but I need to show to the user the progress of
the operation and here is the problem. I try to access to the Session
Variables from inside the thread to show it on a page that automatically
refresh, BUT, I have discovered that there is no access to the httpcontext
from inside the new thread. Is there any other way to do this??

Thanks a lot.

--
Roberto López
Dpto. Soporte Software
Eurosistemas Informáticos y Comunicaciones, S.L.

推荐答案

这是一篇文章:

http://www.ftponline.com/vsm /2002_11...tures/chester/

-

S. Justin Gengo,MCP

Web开发人员


免费代码库:
www。 aboutfortunate.com


混乱无序。

Nietzche

"RobertoLópez" ; < RL **** @ eurosistemas.net>在消息中写道

新闻:%2 **************** @ TK2MSFTNGP11.phx.gbl ...
Here''s an article:

http://www.ftponline.com/vsm/2002_11...tures/chester/

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Roberto López" <rl****@eurosistemas.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...

我正在做一个asp.net应用程序,它在客户端和我的Intranet上的服务器之间上传和下载文件和
文件夹。要做到这一点,我
有创建线程,它运行正常,但我需要向用户显示操作的进度
,这是问题所在。我尝试从线程内部访问Session
变量,在一个自动刷新的页面上显示它,但是,我发现从内部无法访问httpcontext
新线程。还有其他办法吗?

非常感谢。

-
RobertoLópez
Dpto。 Soporte Software
EurosistemasInformáticosyComunicaciones,SL
Hi,
I′m doing an asp.net application that uploads and downloads files and
folders between the client and the server on my intranet. To do this I have create threads and it runs Ok but I need to show to the user the progress of the operation and here is the problem. I try to access to the Session
Variables from inside the thread to show it on a page that automatically
refresh, BUT, I have discovered that there is no access to the httpcontext
from inside the new thread. Is there any other way to do this??

Thanks a lot.

--
Roberto López
Dpto. Soporte Software
Eurosistemas Informáticos y Comunicaciones, S.L.



我刚读过这篇文章,但我需要的是访问会话

来自班级内的对象。这样做我alwais收到错误。

S。 Justin Gengo < SJ ***** @ aboutfortunate.com> escribiónenel mensaje

新闻:#m ************** @ TK2MSFTNGP11.phx.gbl ...
I just readed this article but, what i need is to access to the session
object from within a class. And doing it I alwais receive an error.
"S. Justin Gengo" <sj*****@aboutfortunate.com> escribió en el mensaje
news:#m**************@TK2MSFTNGP11.phx.gbl...
这里''一篇文章:

http ://www.ftponline.com/vsm/2002_11...tures/chester/

- S. Justin Gengo,MCP
Web开发人员

免费代码库:
www.aboutfortunate.com

出于混乱,订单。Nietzche
RobertoLópez < RL **** @ eurosistemas.net>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP11.phx.gbl ...
Here''s an article:

http://www.ftponline.com/vsm/2002_11...tures/chester/

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Roberto López" <rl****@eurosistemas.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...

我正在做一个asp.net应用程序,它在我的内联网上的客户端和服务器之间上传和下载文件和
文件夹。要做到这一点,我有
Hi,
I′m doing an asp.net application that uploads and downloads files and
folders between the client and the server on my intranet. To do this I have
创建线程,它运行正常,但我需要向用户显示
create threads and it runs Ok but I need to show to the user the progress of

进度操作,这就是问题所在。我尝试从线程内部访问Session
变量,以便在自动刷新的页面上显示它,但是,我发现无法访问
the operation and here is the problem. I try to access to the Session
Variables from inside the thread to show it on a page that automatically
refresh, BUT, I have discovered that there is no access to the



来自新线程内部的httpcontext。还有其他办法吗?

非常感谢。

-
RobertoLópez
Dpto。 Soporte Software
EurosistemasInformáticosyComunicaciones,S.L。


httpcontext from inside the new thread. Is there any other way to do this??

Thanks a lot.

--
Roberto López
Dpto. Soporte Software
Eurosistemas Informáticos y Comunicaciones, S.L.




出现同样的错误。出于某种原因,当新线程从一个类启动时,httpcontext对该线程设置为null。如果是从

aspx页面完成,则没有错误。为什么?我不知道。

S。 Justin Gengo < SJ ***** @ aboutfortunate.com> escribiónenel mensaje

新闻:#v ************* @ TK2MSFTNGP10.phx.gbl ...
The same error appears. For some reason, when the new thread is started from
a class, the httpcontext is set to null to the thread. If it is done from a
aspx page there is no error. Why? I don′t know.
"S. Justin Gengo" <sj*****@aboutfortunate.com> escribió en el mensaje
news:#v*************@TK2MSFTNGP10.phx.gbl...
如何通过会话对象通过公共属性进入类?

S. Justin Gengo,MCP
Web开发人员

免费代码图书馆:
www.aboutfortunate.com

出于混乱而来的顺序。Nietzche
RobertoLópez < RL **** @ eurosistemas.net>在消息中写道
新闻:Ow **************** @ TK2MSFTNGP10.phx.gbl ...
How about passing the session object into the class through a public
property?

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Roberto López" <rl****@eurosistemas.net> wrote in message
news:Ow****************@TK2MSFTNGP10.phx.gbl...
我刚刚读了这篇文章,但是,我需要的是从类中访问会话
对象。这样做我alwais收到错误。

S。 Justin Gengo < SJ ***** @ aboutfortunate.com> escribióenel mensaje
新闻:#m ************** @ TK2MSFTNGP11.phx.gbl ...
I just readed this article but, what i need is to access to the session
object from within a class. And doing it I alwais receive an error.
"S. Justin Gengo" <sj*****@aboutfortunate.com> escribió en el mensaje
news:#m**************@TK2MSFTNGP11.phx.gbl...
这是一篇文章:

http:// www .ftponline.com / vsm / 2002_11 ... tures / chester /

- S. Justin Gengo,MCP
Web开发人员

免费代码库:
www.aboutfortunate.com
出于混乱而有序。Nietzche
RobertoLópez < RL **** @ eurosistemas.net>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP11.phx.gbl ...
>
>我正在做一个上传和下载文件的asp.net应用程序
和>客户端和我的Intranet上的服务器之间的文件夹。要做这个
我有
>创建线程并运行Ok但是我需要向用户显示
Here''s an article:

http://www.ftponline.com/vsm/2002_11...tures/chester/

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Roberto López" <rl****@eurosistemas.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
> Hi,
> I′m doing an asp.net application that uploads and downloads files and > folders between the client and the server on my intranet. To do this I have
> create threads and it runs Ok but I need to show to the user the


进度


>操作,这是问题所在。我尝试访问
Session>线程内部的变量在自动>的页面上显示它。刷新,但是,我发现无法访问
of
> the operation and here is the problem. I try to access to the Session > Variables from inside the thread to show it on a page that automatically > refresh, BUT, I have discovered that there is no access to the


httpcontext


httpcontext

>从新线程内部。还有其他办法吗?
>
>非常感谢。
>
> -
> RobertoLópez
> DPTO。 Soporte软件
> EurosistemasInformáticosyComunicaciones,SL
>
>
> from inside the new thread. Is there any other way to do this??
>
> Thanks a lot.
>
> --
> Roberto López
> Dpto. Soporte Software
> Eurosistemas Informáticos y Comunicaciones, S.L.
>
>





这篇关于线程和会话对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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