Gửi bởi
astrologic
Mã:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="757" height="304" id="<%= item.ImagePatch %>" align="">
<param name="movie" value="<%= item.ImagePatch %>">
<param name="quality" value="high">
<param name="bgcolor" value="#333399">
<embed src="<%= item.ImagePatch %>" quality="high" bgcolor="#333399" width="757" height="304" name="<%= item.ImagePatch %>" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"></embed>
</object>
Mã:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Data.SqlClient;
using System.Web.UI.WebControls;
using BLL;
using DAL;
public partial class Desktop_Plays : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
lblPlay.Text = GameFlash();
}
VipGaneDataContext db = new VipGaneDataContext();
Game Game = new Game();
int ma = int.Parse(Request["GameID"].ToString()); // lấy mã sp
Game = db.Games.Where(s => s.GameID == ma).FirstOrDefault(); //tìm sp có mã = mã đã lấy ở trên
// cập nhật lượt xem
if (Game.Luotchoi == null || Game.Luotchoi == 0)
Game.Luotchoi = 1;
else
Game.Luotchoi += 1;
db.SubmitChanges(); // lưu xuống csdl
//đoạn dưới dùng để hiển thị lên trình duyệt thông tin chi chiết sản phẩm
var tensp = from sp in db.Games
where sp.GameID == ma
select sp; //lấy all các thông tin của sản phẩm
//foreach (game s in tensp)
//{
// lblTenSP.Text = s.TenSP;
// lblLuotXem.Text = s.luotxem.ToString();
// }
}
#region "Flash"
public string GameFlash()
{
string StrBanner = "";
string connectString = @"Server =.;Initial Catalog=Game;User ID=sa;Password=itvn";
// Khai báo câu truy vấn
string sql = @"SELECT top 1 GameID, flashUrl FROM Game where Luotchoi=(Select MAX(Luotchoi) from Game)";
// Tạo một connection tới máy chủ
SqlConnection conn = new SqlConnection(connectString);
try
{
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
StrBanner += "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'";
StrBanner += " style='height: 470' width='628'>";
StrBanner += " <param name='movie'";
StrBanner += " <param name='quality' value='high' />";
StrBanner += " <embed height='470' pluginspage='http://www.macromedia.com/go/getflashplayer' quality='high'";
StrBanner += " src='../Flash/" + reader[1] + "' type='application/x-shockwave-flash' width='628'>";
StrBanner += " </embed>";
StrBanner += " </object>";
}
return StrBanner;
}
catch
{
return "";
}
}
#endregion
}
Mình dùng code trên thì cú game nào nhìu người chơi nó sẽ lấy lên.!
bạn đưa cái đoạn code đó m k bit add vài thế nào ..lấy GameID ở chỗ nào vậy.
Dưới ánh nắng mặt trời đang lên, những đống pallet nhựa An Giang trải dài mênh mông như những bức tranh tự nhiên đầy sắc màu. Mỗi chiếc pallet nhựa không chỉ là một vật dụng thông thường mà còn là...
Pallet nhựa An Giang giao hàng...