{"id":698,"date":"2009-10-29T10:48:00","date_gmt":"2009-10-29T02:48:00","guid":{"rendered":""},"modified":"2013-11-17T12:39:17","modified_gmt":"2013-11-17T04:39:17","slug":"c%e6%92%ad%e6%94%be%e5%a3%b0%e9%9f%b3%e5%92%8cflash","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/698.html","title":{"rendered":"C#\u64ad\u653e\u58f0\u97f3\u548cFlash"},"content":{"rendered":"<p>\u4e00\u3001\u5728C#\u64ad\u653e\u58f0\u97f3 \u65b0\u5efa\u4e00\u4e2aC#\u7684Windows Form\u5de5\u7a0b(Windows\u5e94\u7528\u7a0b\u5e8f)\uff0c\u5e76\u4e14\u5b9a\u4e49\u4e24\u4e2a\u83dc\u5355\u6309\u94ae\uff08menuItem1,menuItem2\uff09\u3002 \u9009\u62e9\u83dc\u5355\u4e2d\u7684\u201c\u5de5\u5177\u201d\u4e2d\u7684\u201c\u81ea\u5b9a\u4e49\u5de5\u5177\u7bb1(\u6dfb\u52a0\/\u79fb\u9664\u5de5\u5177\u7bb1\u9879)\u201d\uff0c\u5728\u81ea\u5b9a\u4e49\u5de5\u5177\u7bb1\u7684\u7a97\u53e3\u4e2d\uff0c\u70b9\u51fb\u5c55\u5f00\u201cCOM \u7ec4\u4ef6\u201d\u9879\uff0c\u9009\u4e2d\u201cWindow Media Player\u201d\u9009\u9879\u3002\u786e\u5b9a\u540e\u5728\u201c\u5de5\u5177\u7bb1\u201d\u4e2d\u4fbf\u4f1a\u51fa\u73b0\u201cWindows Media Player\u201d\u8fd9\u4e00\u9879\uff0c\u7136\u540e\u518d\u5c06\u5176\u62d6\u81f3Form\u4e0a\uff0c\u8c03\u6574\u5927\u5c0f\uff0c\u7cfb\u7edf\u5728\u201c\u5f15\u7528\u201d\u4e2d\u81ea\u52a8\u52a0\u5165\u4e86\u5bf9\u6b64dll\u7684\u5f15\u7528\uff0cAxMediaPlayer\u5c31\u662f\u6211\u4eec\u4f7f\u7528\u7684Namespace\u4e0eclass\u3002 \u5728\u5c5e\u6027\u680f\u4e2d\u8bbe\u7f6e\u597d\u6b64\u63a7\u4ef6\u7684\u4e00\u4e9b\u5c5e\u6027\uff0c\u4e3a\u4e86\u65b9\u4fbf\uff0c\u8fd9\u91cc\u6211\u628aAutoStart\u8bbe\u7f6e\u6210\u4e3atrue\uff08\u5176\u5b9e\u9ed8\u8ba4\u662ftrue\uff09\uff0c\u53ea\u8981FileName\u88ab\u8bbe\u7f6e(\u6253\u5f00\u4e86\u6587\u4ef6)\uff0c\u5219\u6587\u4ef6\u5c06\u4f1a\u81ea\u52a8\u64ad\u653e\u3002\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nprivate void menuItem1_Click(object sender, System.EventArgs e)\r\n{\r\n OpenFileDialog ofDialog = new OpenFileDialog();\r\n ofDialog.AddExtension = true;\r\n ofDialog.CheckFileExists = true;\r\n ofDialog.CheckPathExists = true;\r\n ofDialog.Filter = &quot;VCD\u6587\u4ef6(*.dat)|*.dat|Audio\u6587\u4ef6(*.avi)|*.avi|WAV\u6587\u4ef6(*.wav)|*.wav|MP3\u6587\u4ef6(*.mp3)|*.mp3|\u6240\u6709\u6587\u4ef6 (*.*)|*.*&quot;;\r\n ofDialog.DefaultExt = &quot;*.mp3&quot;;\r\n if(ofDialog.ShowDialog() == DialogResult.OK)\r\n {\r\n  \/\/ 2003\u4e00\u4e0b\u7248\u672c \u65b9\u6cd5 this.axMediaPlayer1.FileName = ofDialog.FileName;\r\n  this.axMediaPlayer1.URL= ofDialog.FileName;\/\/2005\u7528\u6cd5\r\n }\r\n}\r\n\r\n<\/pre>\n<p>\u8fd9\u91cc\u4f7f\u7528\u7684\u662f\u5fae\u8f6f\u7684\u64ad\u653e\u5668\uff0c\u5927\u5bb6\u4e5f\u53ef\u4ee5\u8bd5\u8bd5Winamp\u7684\u63a7\u4ef6\uff0c\u5982\u679c\u4f60\u53ea\u9700\u8981\u64ad\u653e\u58f0\u97f3\u800c\u4e0d\u9700\u8981\u663e\u793a\uff0c\u4f60\u53ea\u8981\u628aAxMediaPlayer\u7684Visible\u5c5e\u6027\u8bbe\u7f6e\u4e3afalse\u5c31\u53ef\u4ee5\u4e86\u3002 \u4e8c\u3001\u64ad\u653eFlash\u52a8\u753b \u64ad\u653eFlash\u52a8\u753b\u7684\u539f\u7406\u4e0e\u58f0\u97f3\u5dee\u4e0d\u591a\uff0c\u4e5f\u662f\u76f4\u63a5\u5f15\u7528Flash\u7684dll\uff0c\u4e0d\u8fc7\u8fd9\u4e2adll\u4e0d\u80fd\u76f4\u63a5\u5728\u201cCOM \u7ec4\u4ef6\u201d\u7a97\u53e3\u4e2d\u627e\u5230\uff0c\u9700\u8981\u6211\u4eec\u624b\u52a8\u6dfb\u52a0\uff0c\u9009\u62e9\u83dc\u5355\u4e2d\u7684\u201c\u5de5\u5177\u201d&#8211;\u201c\u81ea\u5b9a\u4e49\u5de5\u5177\u7bb1\u201d\uff0c\u6253\u5f00\u201c\u81ea\u5b9a\u4e49\u5de5\u5177\u7bb1\u201d\u7a97\u53e3\uff0c\u5728\u201cCOM \u7ec4\u4ef6\u201d\u4e2d\u70b9\u51fb\u201c\u6d4f\u89c8\u201d\u952e\uff0c\u7136\u540e\u9009\u62e9\u201cc:\\\\WINNT(WINDOWS)\\\\system32\\\\MacromedFlashswflash.ocx&#8221;\u63a7\u4ef6\uff0c\u786e\u5b9a\u540e\u5728\u5de5\u5177\u7bb1\u4e2d\u5c31\u53ef\u4ee5\u770b\u5230\u201cFlashFactory\u201d\uff0c\u201cShockwaveFlash\u201d\u4e24\u4e2a\u65b0\u63a7\u4ef6\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528\u7684\u662f\u201cShockwaveFlash\u201d\uff0c\u5c06\u5176\u62d6\u5230\u65b0\u5efa\u7684Form\u4e0a\uff0c\u7136\u540e\u518d\u8bbe\u7f6e\u4e00\u4e9b\u5c5e\u6027\u5373\u53ef\u3002 \u4e0b\u9762\u662f\u7b80\u5355\u7684\u64cd\u4f5c\u4ee3\u7801\uff0c\u5373\u6253\u5f00swf\u6587\u4ef6\uff0c\u5e76\u64ad\u653e\u5b83\uff1a <\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\r\nprivate void menuItem2_Click(object sender, System.EventArgs e)\r\n{\r\n OpenFileDialog ofDialog = new OpenFileDialog();\r\n ofDialog.AddExtension = true;\r\n ofDialog.CheckFileExists = true;\r\n ofDialog.CheckPathExists = true;\r\n ofDialog.Filter = &quot;swf \u6587\u4ef6 (*.swf)|*.swf|\u6240\u6709\u6587\u4ef6 (*.*)|*.*&quot;;\r\n ofDialog.DefaultExt = &quot;mp3&quot;;\r\n if(ofDialog.ShowDialog() == DialogResult.OK)\r\n {\r\n  this.axShockwaveFlash1.Movie = ofDialog.FileName;\r\n  this.axShockwaveFlash1.Play();\r\n }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u5728C#\u64ad\u653e\u58f0\u97f3 \u65b0\u5efa\u4e00\u4e2aC#\u7684Windows Form\u5de5\u7a0b(Windows\u5e94\u7528\u7a0b\u5e8f)\uff0c\u5e76\u4e14\u5b9a\u4e49\u4e24\u4e2a\u83dc\u5355\u6309\u94ae [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-698","post","type-post","status-publish","format-standard","hentry","category-code_related"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=698"}],"version-history":[{"count":2,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/698\/revisions"}],"predecessor-version":[{"id":4591,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/698\/revisions\/4591"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}