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.
精彩评论