C#在内存中播放Flash

C#在内存中播放Flash

  1. /// <summary>
  2.         /// 播入flsh数据
  3.         /// </summary>
  4.         /// <param name=”flash”></param>flash控件
  5.         /// <param name=”data”></param>flash数据
  6.         private void PlayFlash(AxShockwaveFlashObjects.AxShockwaveFlash flash,byte[]data)
  7.         {
  8.             using (MemoryStream ms = new MemoryStream())
  9.             {
  10.                 using(BinaryWriter bw=new BinaryWriter(ms))
  11.                 {
  12.                     bw.Write(8 + data.Length);
  13.                     bw.Write(0x55665566);
  14.                     bw.Write(data.Length);
  15.                     bw.Write(data);
  16.                     ms.Seek(0, SeekOrigin.Begin);
  17.                     flash.OcxState = new AxHost.State(ms, 1, false, null);
  18.                 }
  19.             }
  20.         }

标签