C#在内存中播放Flash
[csharp]
/// <summary>
/// 播入flsh数据
/// </summary>
/// <param name="flash"></param>flash控件
/// <param name="data"></param>flash数据
private void PlayFlash(AxShockwaveFlashObjects.AxShockwaveFlash flash,byte[]data)
{
using (MemoryStream ms = new MemoryStream())
{
using(BinaryWriter bw=new BinaryWriter(ms))
{
bw.Write(8 + data.Length);
bw.Write(0x55665566);
bw.Write(data.Length);
bw.Write(data);
ms.Seek(0, SeekOrigin.Begin);
flash.OcxState = new AxHost.State(ms, 1, false, null);
}
}
}
/// <summary>
/// 播入flsh数据
/// </summary>
/// <param name="flash"></param>flash控件
/// <param name="data"></param>flash数据
private void PlayFlash(AxShockwaveFlashObjects.AxShockwaveFlash flash,byte[]data)
{
using (MemoryStream ms = new MemoryStream())
{
using(BinaryWriter bw=new BinaryWriter(ms))
{
bw.Write(8 + data.Length);
bw.Write(0x55665566);
bw.Write(data.Length);
bw.Write(data);
ms.Seek(0, SeekOrigin.Begin);
flash.OcxState = new AxHost.State(ms, 1, false, null);
}
}
}
补充:软件开发 , C# ,