コード例 #1
0
        public void ProcessRequest(HttpContext context)
        {
            StringBuilder sb = new StringBuilder();

            context.Response.ContentType = "application/json";
            string id = context.Request.Form["id"];
            //根据id查询单个值
            VideoInfoBLL vib = new VideoInfoBLL();
            VideoInfo    vi  = vib.FindOneVideo(id);

            if (!string.IsNullOrEmpty(vi.VideoTitle))
            {
                sb.Append("[");
                sb.Append("{");
                sb.Append("\"title\":\"" + vi.VideoTitle + "\",");
                sb.Append("\"url\":\"" + vi.VideoUrl + "\",");
                sb.Append("\"meettime\":\"" + vi.VideoTime + "\"");
                //sb.Append("\"id\":\"" + list[i].Bj_Id + "\",");
                sb.Append("}");
                sb.Append("]");
            }


            context.Response.ContentEncoding = Encoding.UTF8;

            context.Response.Write(sb);

            context.Response.End();
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["username"] == null)
            {
                Response.Redirect("Login.aspx");
            }
            //接受id
            string       id  = Request.QueryString["id"];
            VideoInfoBLL vib = new VideoInfoBLL();

            vi = vib.FindOneVideo(id);
            Page.DataBind();
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            VideoInfoBLL vib          = new VideoInfoBLL();
            string       title        = Request.Form["meetTitle"];
            string       meetId       = Request.Form["meetId"];
            string       meetUrl      = Request.Form["meetUrl"];
            string       meetLongTime = Request.Form["meetLongTime"];
            string       meetTime     = Request.Form["meetTime"];
            string       meet_img     = Request.Form["meet_img"];
            string       meetMemo     = Request.Form["meetMemo"];
            //  HttpPostedFile hpf = Request.Files["product_img"];
            VideoInfo vi = new VideoInfo();

            vi               = vib.FindOneVideo(meetId);
            vi.VideoTitle    = title;
            vi.VideoTime     = meetTime;
            vi.Id            = meetId;
            vi.VideoTimeLong = meetLongTime;
            vi.VideoMemo     = meetMemo;
            vi.VideoUrl      = meetUrl;



            if (Request.Files[0].FileName != "")
            {
                Random r  = new Random();
                string ex = System.IO.Path.GetExtension(Request.Files[0].FileName).ToLower();
                if (".jpg.gif.png.bmp".Contains(ex))
                {
                    string newFileName = DateTime.Now.ToString("yyyyMMddHHmmss") + r.Next(100, 999).ToString() + ex;



                    vi.VideoImg = newFileName;
                    Request.Files[0].SaveAs(Server.MapPath("~/image/" + newFileName));
                    pic = newFileName;
                }
            }



            if (vib.UpdateVideoInfo(vi) > 0)
            {
                Response.Redirect("ShowAllVideo.aspx");
            }
        }
コード例 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["username"] == null)
            {
                Response.Redirect("Login.aspx");
            }

            //接受id
            string       id  = Request.QueryString["id"];
            VideoInfoBLL vib = new VideoInfoBLL();
            VideoInfo    v   = vib.FindOneVideo(id);

            vi.VideoTime     = FormatDate(v.VideoTime);
            vi.VideoTitle    = v.VideoTitle;
            vi.VideoUrl      = v.VideoUrl;
            vi.VideoMemo     = v.VideoMemo;
            vi.VideoImg      = v.VideoImg;
            vi.VideoTimeLong = v.VideoTimeLong;
            vi.Id            = v.Id;
            Page.DataBind();
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)  //usercode
        {
            usercode = Request.QueryString["usercode"];
            if (!IsPostBack)
            {
                EJUWebService.UCWebService ejuws = new EJUWebService.UCWebService();

                returnbk.Visible = false;
                //if (!(ejuws.CheckLogin(usercode)))
                //{
                //    Response.Redirect("http://in.eju.com");
                //}
                //else
                //{

                #region
                this.litreturnzhibo.Text = "<a href=\"WatchVideo.aspx?usercode=" + usercode + "\">回到直播</a>";

                int.TryParse(Request.QueryString["p"], out _page);
                _page = _page < 1 ? 1 : _page;
                VideoInfoBLL     vib  = new VideoInfoBLL();
                List <VideoInfo> list = null;
                list = vib.FindAllVideo(_page, _pagesize, out _count);
                if (list != null && list.Count > 0)
                {
                    video_rpt.DataSource = list;
                    page_str.Text        = CreatePageList("videopage", _pagesize, _count, _page, out _total_page);
                    page_hide.Text       = _page.ToString();
                }
                else
                {
                    this.litMsg.Text = "暂无视频";
                }
                //查询初始路径

                VideoLiveBLL  vlb = new VideoLiveBLL();
                VideoLiveInfo vli = vlb.FindMaxVideo();
                //Response.Write(vli.LiveVideoUrl);
                string id = Request.QueryString["id"];

                #region 拼接js

                //第一次登陆
                if (string.IsNullOrEmpty(id))
                {
                    sb.Append("jwplayer('mediaspace').setup({");
                    sb.Append(" 'screencolor':'FFFFFF',");
                    sb.Append(" 'flashplayer': 'player.swf',");
                    sb.Append(" 'file': 'livestream1',");
                    sb.Append(" 'image': 'image/eju.png',");
                    sb.Append("'streamer': '" + vli.LiveVideoUrl + "',");
                    sb.Append("'controlbar': 'bottom',");
                    sb.Append("'width': '556',");
                    sb.Append(" 'height': '384',");
                    sb.Append(" 'stretching':'fill' ");
                    sb.Append("});");
                }
                else
                {
                    returnbk.Visible = true;
                    //根据id查询
                    VideoInfo vi = vib.FindOneVideo(id);
                    meet_time.Text = FormatDate(vi.VideoTime);
                    meet_top.Text  = vi.VideoTitle;
                    string filename = vi.VideoUrl.Substring(vi.VideoUrl.LastIndexOf("/") + 1);
                    sb.Append("jwplayer('mediaspace').setup({");
                    sb.Append(" 'screencolor':'FFFFFF',");
                    sb.Append(" 'flashplayer': 'player.swf',");
                    sb.Append(" 'file': '" + filename + "',");
                    sb.Append(" 'image': 'image/eju.png',");
                    int fileindex = vi.VideoUrl.LastIndexOf("/");
                    sb.Append("'streamer': '" + vi.VideoUrl.Substring(0, fileindex) + "',");
                    sb.Append("'controlbar': 'bottom',");
                    sb.Append("'width': '556',");
                    sb.Append(" 'height': '384',");
                    sb.Append("'stretching':'fill'");
                    sb.Append("});");
                }
                #endregion
                Page.DataBind();
                #endregion
                //}
            }
        }