473,406 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

What is the Web App equivilent to this WinForm Class?

I can't find the followings equivilent:

flashPlayer.Movie = Application.StartupPath + @"/Cooler2.swf";
flashPlayer.FSCommand +=new
AxShockwaveFlashObjects._IShockwaveFlashEvents_FSC ommandEventHandler(flashPlayer_FSCommand);

Any help is appreciated.
Thanks,
Trint

Nov 17 '05 #1
4 3553
Trint,

There really isn't a direct conversion. If you want the local path on
the web server, then use the MapPath method on the HttpServerUtility class
(exposed through the Page on the Server property) to find it. You can get
the local directory of the root directory for the web application with:

// Get the local path.
string localPath = Server.MapPath("/");

You can also use the ApplicationPath, CurrentExecutionFilePath,
FilePath, Path, PhysicalApplicationPath, PhysicalPath properties on the
HttpRequest (exposed through the Request property) for other path
information related to the request.

I would recommending figuring out which would suit your needs, and then
use one of those.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"trint" <tr***********@gmail.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
I can't find the followings equivilent:

flashPlayer.Movie = Application.StartupPath + @"/Cooler2.swf";
flashPlayer.FSCommand +=new
AxShockwaveFlashObjects._IShockwaveFlashEvents_FSC ommandEventHandler(flashPlayer_FSCommand);

Any help is appreciated.
Thanks,
Trint

Nov 17 '05 #2
Still trying...getting this:

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.

Source Error:
Line 36: // Put user code to initialize the page here
Line 37: string localPath = Server.MapPath(@"/Cool3.swf");
Line 38: flashPlayer.Movie = localPath;
Line 39: //Handle the FSCommand event that comes in from Flash
Line 40: flashPlayer.FSCommand +=new
AxShockwaveFlashObjects._IShockwaveFlashEvents_FSC ommandEventHandler(fla
shPlayer_FSCommand);
and....

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.

Source Error:
Line 36: // Put user code to initialize the page here
Line 37: string localPath = Page.Request.ApplicationPath +
"/Cool3.swf";
Line 38: flashPlayer.Movie = localPath;
Line 39: //Handle the FSCommand event that comes in from Flash
Line 40: flashPlayer.FSCommand +=new
AxShockwaveFlashObjects._IShockwaveFlashEvents_FSC ommandEventHandler(fla
shPlayer_FSCommand);

Thanks,
Trint

..Net programmer
tr***********@gmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3
Trint,

Are you actually running this in the context of ASP.NET?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Trint Smith" <tr***********@gmail.com> wrote in message
news:Of***************@tk2msftngp13.phx.gbl...
Still trying...getting this:

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.

Source Error:
Line 36: // Put user code to initialize the page here
Line 37: string localPath = Server.MapPath(@"/Cool3.swf");
Line 38: flashPlayer.Movie = localPath;
Line 39: //Handle the FSCommand event that comes in from Flash
Line 40: flashPlayer.FSCommand +=new
AxShockwaveFlashObjects._IShockwaveFlashEvents_FSC ommandEventHandler(fla
shPlayer_FSCommand);
and....

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.

Source Error:
Line 36: // Put user code to initialize the page here
Line 37: string localPath = Page.Request.ApplicationPath +
"/Cool3.swf";
Line 38: flashPlayer.Movie = localPath;
Line 39: //Handle the FSCommand event that comes in from Flash
Line 40: flashPlayer.FSCommand +=new
AxShockwaveFlashObjects._IShockwaveFlashEvents_FSC ommandEventHandler(fla
shPlayer_FSCommand);

Thanks,
Trint

Net programmer
tr***********@gmail.com

*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #4
Is cool3.swf in the root of the application directory or in a sub directory.
My guess is that you have the wrong path. Response.Write(localPath) and I
bet you find your issue.

"Nicholas Paldino [.NET/C# MVP]" wrote:
Trint,

Are you actually running this in the context of ASP.NET?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Trint Smith" <tr***********@gmail.com> wrote in message
news:Of***************@tk2msftngp13.phx.gbl...
Still trying...getting this:

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.

Source Error:
Line 36: // Put user code to initialize the page here
Line 37: string localPath = Server.MapPath(@"/Cool3.swf");
Line 38: flashPlayer.Movie = localPath;
Line 39: //Handle the FSCommand event that comes in from Flash
Line 40: flashPlayer.FSCommand +=new
AxShockwaveFlashObjects._IShockwaveFlashEvents_FSC ommandEventHandler(fla
shPlayer_FSCommand);
and....

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.

Source Error:
Line 36: // Put user code to initialize the page here
Line 37: string localPath = Page.Request.ApplicationPath +
"/Cool3.swf";
Line 38: flashPlayer.Movie = localPath;
Line 39: //Handle the FSCommand event that comes in from Flash
Line 40: flashPlayer.FSCommand +=new
AxShockwaveFlashObjects._IShockwaveFlashEvents_FSC ommandEventHandler(fla
shPlayer_FSCommand);

Thanks,
Trint

Net programmer
tr***********@gmail.com

*** Sent via Developersdex http://www.developersdex.com ***


Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Danny | last post by:
struct B: public A { int & b B(int & a) : A(a), b(a){} }; Is A(a), b(a) calling the constructor I have never seen this syntax. Would this be equivilent to
8
by: Crash | last post by:
2 Questions, but first Consider this: I'm looking at a C++ class (patterned using the Singleton Design Pattern). It has some public and private operations. It runs quite happily seving the time...
2
by: trint | last post by:
How can I do this WinForm code in a WebForm please? this.TextBox1.AppendText(Environment.NewLine); this.textBox1.AppendText(Calendar1.SelectedDate.ToShortDateString()); Thanks, Trint
2
by: Steve1 via DotNetMonster.com | last post by:
Hi all, I'm producing a data conversion app in C#. I have the code already written in VB6. I would to know if anyone knows of any links that shows the VB6 function/syntax equivilent in C#? ...
2
by: Wayne | last post by:
I have a winform that runs on its own, is it possible to wrap a stand-alone winform in a class? More accurately, is it possible to use a class to call an already established winform?
0
by: Syed Zaidi via .NET 247 | last post by:
I am working on a small project in which i want to develop acustom toolbar skeleton for handling database navigation. I havecreated a usercontrol consist of a toolbar inherits fromusercontrol and...
3
by: Abubakar | last post by:
Hi, I have used the Monitor/manualresetevent class in .net to sycnhronize threads in C#, right now I'm programming in pure c++ and win32 and want to acheive the same functionality. Whats the...
4
by: randy1200 | last post by:
I have a WinForm class that has accumulated a tremendous amount of logic code. Can anyone point me toward a good article on factoring logic code out of a WinForm class? Thanks, -- Randy
1
by: TerryStone | last post by:
I am writing a Windows application, with an SQL Server (Express) database. The application is single user. The Windows application is the only application that accesses the database. I have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.