Silverlight2
ได้รับการออกแบบมาสำหรับ online scenario ซึ่งในบางครั้งเราอาจจะต้องการให้user
เล่นไฟล์local media ได้ โดยเราสามารถใช้
OpenFileDialog ดังนี้
privateFileStream
fs;
OpenFileDialog ofd =new
OpenFileDialog();
if (ofd.ShowDialog().Value)
{
this.fs = ofd.File.OpenRead();
//me is a MediaElement.
this.me.SetSource(fs);
this.me.Play();
}
Supa Sethasiripong [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.