开发者

Play swf files in C#

开发者 https://www.devze.com 2023-03-22 08:55 出处:网络
I add \'ShockwaveFlashObject\' in toolb开发者_如何学Pythonox and drag it on form and write below code but nothing happen why?

I add 'ShockwaveFlashObject' in toolb开发者_如何学Pythonox and drag it on form and write below code but nothing happen why?

axShockwaveFlash1.Movie=Application.StartupPath+"\flash.swf";
        axShockwaveFlash1.Play();

and

axShockwaveFlash1.LoadMovie(0, Application.StartupPath + "\flash.swf");
        axShockwaveFlash1.Play();


because of escape character;

string path = Application.StartupPath+"\flash.swf";

path is actually equal to C:\Users\username\Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debuglash.swf as you see ...\Debug + \f has converted to Debug

to avoid escaping characters use @

string path = Application.StartupPath+@"\flash.swf";

now path is equal to C:\Users\username\Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\flash.swf

prolly that's what you want to get.

0

精彩评论

暂无评论...
验证码 换一张
取 消