<script runat="server"> protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { if (FileUpload1.HasFile) { string path = @"D:\"; FileUpload1.SaveAs(path + FileUpload1.PostedFile.FileName); Session["src"] = path + FileUpload1.PostedFile.FileName; } } private string str; protected void Button2_Click(object sender, EventArgs e) { str = Session["src"].ToString(); } </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> Upload - <asp:FileUpload ID="FileUpload1" runat="server" /> <asp:Button ID="Button1" runat="server" Text="Upload" OnClick="Button1_Click" /><br /> Play - <asp:Button ID="Button2" runat="server" Text="Button" OnClick="Button2_Click" /><br /> <object id="mediaplayer" classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=5,1,52,701" standby="loading microsoft windows media player components..." type="application/x-oleobject" width="320" height="310"> <param name="filename" value='<%=str %>' /> <param name="animationatstart" value="true" /> <param name="transparentatstart" value="true" /> <param name="autostart" value="true" /> <param name="showcontrols" value="true" /> <param name="ShowStatusBar" value="true" /> <param name="windowlessvideo" value="true" /> <embed src='<%=str %>' autostart="true" showcontrols="true" showstatusbar="1" bgcolor="white" width="320" height="310" /> </object> </div> </form> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)