using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace JumboTCMS.WebFile.PeiXue { public partial class ajax : JumboTCMS.UI.AdminCenter { protected void Page_Load(object sender, EventArgs e) { var ChannelId = Request.Params["ChannelId"]; var ParentId = Request.Params["ParentId"]; var ContentId = Request.Params["ContentId"]; var Content = Request.Params["Content"]; var Ip = GetInternalIP(); var UserName = Request.Cookies["user"]["UserName"]; var result = InserReview(ChannelId, ParentId, ContentId, Content, Ip, UserName); if (result >0) { Response.Write("yes"); } else { Response.Write("no"); } } public int InserReview(String ChannelId, String ParentId, String ContentId, String Content, String Ip, String UserName) { doh.Reset(); doh.SqlCmd = "insert into jcms_normal_review values('" + ChannelId + "','" + ParentId + "','" + ContentId + "','" + DateTime.Now + "','" + Content + "','" + Ip + "','" + UserName + "',1)"; return doh.ExecuteSqlNonQuery(); } private string GetInternalIP() { System.Net.IPHostEntry host; string localIP = "?"; host = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()); foreach (System.Net.IPAddress ip in host.AddressList) { if (ip.AddressFamily.ToString() == "InterNetwork") { localIP = ip.ToString(); break; } } return localIP; } } }