Silverlight Multimedia FAQ: วิธีเปิดและเล่นไฟล์ local media

คำตอบ Silverlight Multimedia FAQ: วิธีเปิดและเล่นไฟล์ local media

ตอบทั้งหมด

  • 15 กุมภาพันธ์ 2555 6:24
    ผู้ดูแล
     
     คำตอบ


    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.

    • ทำเครื่องหมายเป็นคำตอบโดย supa_sModerator 16 กุมภาพันธ์ 2555 2:07
    •