best way to have global, application level objects

  • Thread starter Thread starter Craig Traxler
  • Start date Start date
C

Craig Traxler

I would like to create an instance of Windows Media Player that I can
manipulate from within ASP.NET pages. Do I just create an instance of
Windows Media Player from within the Application_OnStart event in
global.asax? If so, how do I reference this object in a page event?

Is this a dumb way to do it? Any help is appreciated.
 
You can store the object in the Application object in the Application_Start event. Then, in you pages, you can refer to this object by retrieving it from the Application object

MyClass obj = (MyClass)Application["WMP"]

Tu-Thac
www.ongtech.co

----- Craig Traxler wrote: ----

I would like to create an instance of Windows Media Player that I ca
manipulate from within ASP.NET pages. Do I just create an instance o
Windows Media Player from within the Application_OnStart event i
global.asax? If so, how do I reference this object in a page event

Is this a dumb way to do it? Any help is appreciated
 
Hi Craig,

Why on earth do you want to store an instance of Windows Media Player
(client) on your server? It won't help your browser clients.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Because I can think of no other way to control what is played on a pc from a
remote browser.
 
Thanks. I will try to figure out how to do the cast in VB.

Tu-Thach said:
You can store the object in the Application object in the
Application_Start event. Then, in you pages, you can refer to this object
by retrieving it from the Application object:
MyClass obj = (MyClass)Application["WMP"];

Tu-Thach
www.ongtech.com

----- Craig Traxler wrote: -----

I would like to create an instance of Windows Media Player that I can
manipulate from within ASP.NET pages. Do I just create an instance of
Windows Media Player from within the Application_OnStart event in
global.asax? If so, how do I reference this object in a page event?

Is this a dumb way to do it? Any help is appreciated.
 
Well, Craig, you haven't thought of one yet. Windows Media Player (client)
on your server is about as useful as Internet Explorer (client) on your
server. Your clients will never see it.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Thank you for your interest. I do not want to play the media on the client.
I want to play it on the "server."
 
Back
Top