请问如何动态实现播放语音文件[WEB学习示例]

重新发布完整代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class 多媒体播放 : System.Web.UI.Page
{
    DateTime Date = System.DateTime.Now;
    TiShi_XinXi Ts_XinXi = new TiShi_XinXi();
    ShuJuKu_ChaoZuo SJK_CaoZuo = new ShuJuKu_ChaoZuo();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Label2.Text = PlayMedia("Gong_Ju/《南無观世音菩萨》.WMV");
        }

    }
    public string PlayMedia(string MediaFile)
    {
        string strScript = "";
        strScript += "";  
        strScript += "";
        strScript += "";
        strScript += "";
        strScript += "
"; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += ""; strScript += "
"; return strScript; } }

前台网页:

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="多媒体播放.aspx.cs" Inherits="多媒体播放" %>


    


    
 
   

请问如何动态实现播放语音文件[WEB学习示例]_第1张图片

看看另一个播放器,播放网络视频:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class 多媒体播放 : System.Web.UI.Page
{
    DateTime Date = System.DateTime.Now;
    TiShi_XinXi Ts_XinXi = new TiShi_XinXi();
    ShuJuKu_ChaoZuo SJK_CaoZuo = new ShuJuKu_ChaoZuo();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Label2.Text = 网络视频文件("http%3A%2F%2Fwww%2Egdd%2Ero%2Fflvplayer%2Fexamples%2Fvideo%2Emp4&splashscreen=http://www.gdd.ro/flvplayer/examples/fast-and-furious-1.jpg");
        }

    }
    public string 网络视频文件(string MediaFile)
    {
        string strScript = "";
        strScript += "";
        strScript += "";
        strScript += "";
        strScript += "";
        strScript += "
"; strScript += ""; strScript += ""; strScript += "
"; return strScript; } }
请问如何动态实现播放语音文件[WEB学习示例]_第2张图片
来自 点击打开链接 中的 生成器生成的代码写成以上播放器代码,一时找不到合适的网络视频文件地址,地址直接写在里面了,可以自己替换有注释的语句.
播放本地视频文件测试把文件放在一个文件夹中,这里示例为网站工程文件夹 请问如何动态实现播放语音文件[WEB学习示例]_第3张图片Gong_Ju中放一个文件:美女广告.flv,把  http://localhost:1463/GuanLan_ZiYuan/Gong_Ju/美女广告.flv 这个地址用生成器生成复制地址作传递参数:Label2.Text = 网络视频文件("http%3A%2F%2Flocalhost%3A1463%2FGuanLan%5FZiYuan%2FGong%5FJu%2F%E7%BE%8E%E5%A5%B3%E5%B9%BF%E5%91%8A%2Eflv");就可以播放本地文件了.
Label2.Text = 网络视频文件(System.Uri.EscapeDataString("http://localhost:1463/GuanLan_ZiYuan/Gong_Ju/美女广告.flv"));






你可能感兴趣的:(web,string,object,table,border)