积极答复者
如何讲.swf作为资源嵌入到ASP.NET的dll文件里?

问题
-
文件在这http://files.cnblogs.com/ret00100/FlashUpload24.rar
FlashFileUpload.swf FlashUpload.cs
想把里面的类库和swf都编译成dll。。可以实现吗?
答案
-
应该是:在项目下,点击swf文件邮件-,属性里面有:BuildAction选项,选择嵌入http://www.lan27.com/Article/200706/1771.htm
要在你的引用程序中嵌入文件,只需要按下面的步骤操作即可:
1,在资源管理器里选中文件
2,按住鼠标左键,拖到工程文件上,松开鼠标左键。
3,在拖放的文件上点鼠标右键,选“属性”
4,在生成操作里选择“嵌入的资源”。
- 已标记为答案 Xhp 2009年10月14日 6:47
全部回复
-
将FlashFileUpload.swf 添加到项目中,在其属性中设置生成为嵌入的资源
这样就可以通过Assembly.GetMinifestResourceXXX读取
可以采用IHttpHandler或者Ajax那种方式将其显示给用户
Wenn ich dich hab’,gibt es nichts, was unerträglich ist.坚持不懈!http://hi.baidu.com/1987raymond -
请参见 http://msdn.microsoft.com/zh-cn/library/xc4235zt.aspx
Wenn ich dich hab’,gibt es nichts, was unerträglich ist.坚持不懈!http://hi.baidu.com/1987raymond -
http://msdn.microsoft.com/zh-cn/library/e2c9s1d7(VS.80).aspx命令行的做法:(来自网上)
Adding an Embedded Resource to a csc command line compiled assembly
While using Rake to compile and execute NanoContainer.Tests, 4 of my tests kept failing. They were relying on 4 embedded resources that I was not embedding. In Visual Studio it's easy to embed a resource. DevHood and CodeProject both give good information on embedding using Visual Studio.net; however, I wanted to embed a resource using the command line.
MSDN2 provided some good info specific to the command line, but everything I found seemed to detail how to add a .resources or .resx file to an assembly. I needed to add .cs, .js, .java, and .vb files to the assembly. Usingcsc -?
andresgen -?
didn't seem to lead me in the right direction either.
Finally I gave up on finding the documentation I needed and starting shooting in the dark. I used /res, /win32res, and /linkresource. The tests kept failing. /res seemed like the answer, but the documentation focuses on .resources files so there was no way to be sure. Enter James Johnson's demo executable. I'd done everything I could think of and the tests were still failing. It was time to fire up an app that could show me what resources were contained in my assembly.
It turned out that my assembly was embedding the resource correctly when I used /res; however, an identifier needed to be given to match the identifier specified in the NanoContainer tests. Once I added the identifier all the tests passed.
Final correct csc (broken to multiple lines for readablity):csc /out:../build/NanoContainer.Tests.dll /res:'TestScripts/test.cs,NanoContainer.Tests.TestScripts.test.cs' /res:'TestScripts/test.js,NanoContainer.Tests.TestScripts.test.js' /res:'TestScripts/test.java,NanoContainer.Tests.TestScripts.test.java' /res:'TestScripts/test.vb,NanoContainer.Tests.TestScripts.test.vb' /target:library /recurse:*.cs /lib:'../build' /r:'PicoContainer.dll;Microsoft.JScript.dll;VJSharpCodeProvider.dll;Castle.DynamicProxy.dll;NanoContainer.dll;NMock.dll;NUnit.Framework.dll'
-
应该是:在项目下,点击swf文件邮件-,属性里面有:BuildAction选项,选择嵌入http://www.lan27.com/Article/200706/1771.htm
要在你的引用程序中嵌入文件,只需要按下面的步骤操作即可:
1,在资源管理器里选中文件
2,按住鼠标左键,拖到工程文件上,松开鼠标左键。
3,在拖放的文件上点鼠标右键,选“属性”
4,在生成操作里选择“嵌入的资源”。
- 已标记为答案 Xhp 2009年10月14日 6:47