IIS7.5不显示Flash对象 [英] IIS7.5 not displaying Flash object

查看:1250
本文介绍了IIS7.5不显示Flash对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写在ASP.NET MVC中,这应该是服务了由我的一个同事写一个Flash对象的MVC的Web应用程序。我不知道任何Flash;他不知道任何C#/ ASP.NET;因此,问题问到这样的!

I'm writing a MVC web app in ASP.NET MVC, which is supposed to be serving up a Flash object written by one of my colleagues. I don't know any Flash; he doesn't know any C#/ASP.NET; hence the question goes to SO!

我的网页上的code是这样的:

The code on my web page looks like this:

<head>
(blah blah blah...)
  <script type="text/javascript" src="/FlashStuff/js/swfobject.js"></script>
  <script type="text/javascript">
    var GP_MLM_flashvars = {};
    GP_MLM_flashvars.remote = 'true';
    GP_MLM_flashvars.streamprovider = 'localweb';
    GP_MLM_flashvars.referer = '';
    GP_MLM_flashvars.bgcolor = '#000033';
    var GP_MLM_params = {};
    GP_MLM_params.menu = 'false';
    GP_MLM_params.allowFullScreen = 'true';
    GP_MLM_params.salign = 'tl';
    GP_MLM_params.scale = 'noscale';
    GP_MLM_params.wmode = 'opaque';
    GP_MLM_params.bgcolor = '#000033';
    var GP_MLM_attributes = {};
    GP_MLM_attributes.id = 'GP_MLM';
    GP_MLM_attributes.name = 'GP_MLM';
    swfobject.embedSWF('/FlashStuff/swf/GP_MLM.swf', 'GP_MLM', '100%', '100%', '9', '/FlashStuff/expressInstall.swf', GP_MLM_flashvars, GP_MLM_params, GP_MLM_attributes);          
  </script>
</head>
(etc.)

当我调试使用VS开发服务器页面,这一切都显得很开心地和工作正常。但是,如果我尝试使用我的本地IIS调试(7.5)服务器,Flash对象不会被加载。

When I debug this page using the VS Development Server, it all appears very happily and works fine. But if I try to debug using my local IIS (7.5) server, the Flash object doesn't get loaded.

我猜我需要做一些IIS使使用Flash对象 - 但什么

I'm guessing I need to do something on IIS to enable using the Flash object - but what?

编辑:问题部分解决;线索来自于404的错误(感谢@Beliskner)。

Problem partially solved; the clue came from the "404" error (thanks @Beliskner).

看来,当你下VS开发服务器上运行,你的根文件夹是项目文件夹,在我的情况/ FlashStuff谈到直接从我的项目文件夹,这样工作得很好。

It appears that when you're running under the VS Development Server, your root folder is the project folder, and in my case "/FlashStuff" comes directly off my project folder, so that worked fine.

但是,当你运行了IIS服务器,根文件夹是默认Web站点(或任何网站,你正在使用)。现在,一个项目的URL设置为HTTP://本地主机/ MyTestApp,我不得不preFIX我用/ MyTestApp,例如所有路径:

But when you run off the IIS server, the root folder is the Default Web Site (or whatever site you're using). Now, with a project URL set to "http://localhost/MyTestApp", I have to prefix all my paths with "/MyTestApp", e.g.:

<script type="text/javascript" src="/MyTestApp/FlashStuff/js/swfobject.js"></script>

改变了所有的路径;现在工作正常。

Changed all the paths; works fine now.

这是一个pretty难看现在的情况,虽然 - 因为我现在硬编码的具体部署信息到我的应用程序!所以,如果我决定将我的应用程序部署到IIS服务器一个名为MyLiveApp文件夹中,我必须去改变周围的文件引用的处处!如果我想调试它 - 然后呢?去改变所有的引用回MyTestApp?

This is a pretty ugly situation now, though - because I am now hard coding deployment-specific information into my app! So if I decide to deploy my app onto an IIS server in a folder called "MyLiveApp", I have to go around changing the file references everywhere! And if I want to debug it - then what? Go changing all the references back to "MyTestApp"?

显然,我不是第一个开发商碰到这种情况,这是不可想象的,你需要做的,我说什么上面。那么,什么是处理这种情况的把戏?

Obviously I'm not the first developer to come up against this situation, and it is unthinkable that you have to do what I'm saying above. So what is the trick for dealing with this situation?

推荐答案

你有没有安装IIS的MIME类型?你用Firefox的萤火虫来检查请求是不是404ing?

Have you setup the IIS MIME types? Have you used firefox firebug to check the request isn't 404ing?

MIME类型

http://technet.microsoft.com/en -us /库/ cc725608(WS.10)的.aspx - 我建议使用GUI

http://technet.microsoft.com/en-us/library/cc725608(WS.10).aspx - I suggest using the GUI

扩展名:瑞士法郎

类型是:应用程序/ x-冲击波闪光

Type is: "application/x-shockwave-flash"

萤火虫

Firebug的网络监控: http://getfirebug.com/network

Firebug network monitor: http://getfirebug.com/network

修改
使用此解决您的问题:<一href=\"http://www.dailycoding.com/Posts/the_script_tag_runatserver_problem_solution_using_resolveurl.aspx\" rel=\"nofollow\">http://www.dailycoding.com/Posts/the_script_tag_runatserver_problem_solution_using_resolveurl.aspx

这篇关于IIS7.5不显示Flash对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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