string UserIP = Request.UserHostAddress.ToString();
if (Request.Cookies["oldCookie"] != null)
{
string userIP = Request.Cookies["oldCookie"].Value.Trim();
if (UserIP.Trim() == userIP.Trim())
{
Pigeon.Logistic.InfoAlert.AlertAndGoUrl("您已经投过票,不能进行重复投票,谢谢您的参与!", "Vote.aspx");
return;
}
}
else
{
HttpCookie cookie = new HttpCookie("oldCookie", UserIP);
cookie.Expires = DateTime.Now.AddDays(1);
Response.Cookies.Add(cookie);
Int32 _count = Pigeon.Base.UserInfoDAL._UserInstance.getQuestionCount(Int32.Parse( Session["_PageIndex"].ToString()) );
if (_count > 0)
{
try
{
for (int i = 1; i <= _count; i++)
{
if (!String.IsNullOrEmpty(Request.Form["radio_" + i]))
{
Pigeon.Base.UserInfoDAL._UserInstance.EditAnswerCount(Int32.Parse(Request.Form["radio_" + i]));
}
else
{
if (String.IsNullOrEmpty(Request.Form["radio_1"]) || String.IsNullOrEmpty(Request.Form["radio_2"]) || String.IsNullOrEmpty(Request.Form["radio_2"]))
{
Pigeon.Logistic.InfoAlert.AlertAndGoUrl("以上投票项目不可为空,请用户认真填写后进行提交!!!", "Vote.aspx?_pageindex=" + Session["_PageIndex"].ToString());
}
}
}
if (!String.IsNullOrEmpty(Session["_PageIndex"].ToString()))
{
if (Session["_PageIndex"].ToString() == "1" || Session["_PageIndex"].ToString() == "2" || Session["_PageIndex"].ToString() == "3")
{
if (!String.IsNullOrEmpty(Request.Form["radio_1"]) || !String.IsNullOrEmpty(Request.Form["radio_2"]) || !String.IsNullOrEmpty(Request.Form["radio_2"]))
{
Panel3.Visible = true;
}
}
else
{
Pigeon.Base.UserInfoDAL._UserInstance.EditUSerFeeCount(_username);
Response.Write("<script>window.location.href='OK.aspx'</script>");
}
}
}
catch
{
Pigeon.Logistic.InfoAlert.AlertAndGoUrl("投票失败,谢谢您的参与!!!", "Vote.aspx");
}
}
===================================================================================
string UserIP = Request.UserHostAddress.ToString();
if (Request.Cookies["oldCookie"] != null)
{
string userIP = Request.Cookies["oldCookie"].Value.Trim();
if (UserIP.Trim() == userIP.Trim())
{
Pigeon.Logistic.InfoAlert.AlertAndGoUrl("您已经投过票,不能进行重复投票,谢谢您的参与!", "Vote.aspx");
return;
}
}
else
{
HttpCookie cookie = new HttpCookie("oldCookie", UserIP);
cookie.Expires = DateTime.Now.AddDays(1);
Response.Cookies.Add(cookie);
try
{
}
catch
{
Pigeon.Logistic.InfoAlert.AlertAndGoUrl("投票失败,谢谢您的参与!!!", "Vote.aspx");
}
}