Beispiel #1
0
 protected void videoPlay()
 {
     videoInfoModel = videobll.getVideoInfo(id);
     link = videoInfoModel.videoPath;
     playSum = videoInfoModel.playSum;
     videoTitle = videoInfoModel.videoTitle;
     videoContent = videoInfoModel.videoContent;
     videoDate = videoInfoModel.videoDate;
     videoType = videoInfoModel.videoType;
     userName = videoInfoModel.userName;
     flower = videoInfoModel.Flower;
     tile = videoInfoModel.Tile;
     if (!link.StartsWith("http://"))
     {
         //获取当前的绝对路径
         string sss = Request.Url.AbsoluteUri;
         //查询"play.aspx"在字符串中的位置
         int idx = sss.IndexOf("play.aspx");
         //获取指定字符串
         sss = sss.Substring(0, idx);
         link = sss + link;
     }
     //显示播放器并可以播放视频
     this.ltlPlay.Text = common.GetFlashText(link, 540, 405);
 }
Beispiel #2
0
 /// <summary>
 /// 返回视频信息
 /// </summary>
 /// <param name="id">视频编号</param>
 /// <returns></returns>
 public DataTable getVideoInfo(string id)
 {
     VideoInfoModel videoInfoModel = new VideoInfoModel();
     DataTable dt = new DataTable();
     string cmdText = "select * from videoInfo where id=@id";
     SqlParameter[] paras = new SqlParameter[] {
         new SqlParameter ("@id", id)
     };
     dt = sqlhelper.getRow(cmdText, paras, CommandType.Text);
     return dt;
 }
 private void doStore(string saveName)
 {
     VideoInfoModel vim = new VideoInfoModel();
     UInfoModel uim = new UInfoModel();
     vim.userName = uinfo.userName;
     vim.videoTitle = this.txtVideoTitle.Value;
     vim.videoContent = this.txtVideoContent.Value;
     vim.videoPath = "../" + common.playFile + saveName + ".flv";
     vim.videoPicture = "../" + common.imgFile + saveName + ".jpg";
     vim.videoType = this.dropVideoType.SelectedValue.ToString();
     if (userbll.insertVideo(vim))
     {
         uim.userName = uinfo.userName;
         uim.sumMark = "10";//上传一个视频加10个积分;
         userbll.addSumMark(uim);
         string redirect = "message.aspx?cmd=upload&msgid=3&uid=" + uinfo.userName;
         Page.Response.Redirect(redirect);
     }
 }
Beispiel #4
0
 //插入视频信息到数据库
 public bool insertVideo(VideoInfoModel vim)
 {
     return userDAL.insertVideo(vim);
 }
Beispiel #5
0
 //视频信息
 public VideoInfoModel getVideoInfo(string id)
 {
     VideoInfoModel videoInfoModel = new VideoInfoModel();
     dt = videodal.getVideoInfo(id);
     videoInfoModel.Id = dt.DefaultView[0]["id"].ToString();
     videoInfoModel.userName = dt.DefaultView[0]["userName"].ToString();
     videoInfoModel.videoTitle = dt.DefaultView[0]["videoTitle"].ToString();
     videoInfoModel.videoPath = dt.DefaultView[0]["videoPath"].ToString();
     videoInfoModel.videoContent = dt.DefaultView[0]["videoContent"].ToString();
     videoInfoModel.videoDate = dt.DefaultView[0]["videoDate"].ToString();
     videoInfoModel.videoPicture = dt.DefaultView[0]["videoPicture"].ToString();
     videoInfoModel.Flower = int.Parse(dt.DefaultView[0]["Flower"].ToString());
     videoInfoModel.Tile = int.Parse(dt.DefaultView[0]["Tile"].ToString());
     videoInfoModel.playSum = int.Parse(dt.DefaultView[0]["playSum"].ToString());
     videoInfoModel.Auditing = dt.DefaultView[0]["Auditing"].ToString();
     return videoInfoModel;
 }
Beispiel #6
0
 /// <summary>
 /// 上传视频到服务器
 /// </summary>
 /// <param name="vi">视频实体参数</param>
 /// <returns>返回真或假</returns>
 public bool insertVideo(VideoInfoModel vInfo)
 {
     bool flag = false;
     string cmdText = "insert into videoInfo(userName,videoTitle,videoContent,videoPath,videoPicture,videoType) values(@username,@videotitle,@videocontent,@videopath,@videopicture,@videotype)";
     SqlParameter[] paras = new SqlParameter[] {
         new SqlParameter ("@username",vInfo.userName),
         new SqlParameter ("@videotitle",vInfo.videoTitle),
         new SqlParameter ("@videocontent",vInfo.videoContent),
         new SqlParameter ("@videopath",vInfo.videoPath),
         new SqlParameter ("@videopicture",vInfo.videoPicture),
         new SqlParameter ("@videotype",vInfo.videoType)
     };
     int res = sqlhelper.ExecuteNonQuery(cmdText, paras, CommandType.Text);
     if (res > 0)
     {
         flag = true;
     }
     return flag;
 }