关于DataTime的!!
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSetCookie_Click(object sender, EventArgs e)
{
HttpCookie MyCookie1 = new HttpCookie("ClientIP");
MyCookie1.Value = Request.UserHostAddress;
Response.Cookies.Add(MyCookie1);
HttpCookie MyCookie2 = new HttpCookie("LastVist");
MyCookie2.Value = DataTime.Now.Tostring;
Response.Cookies.Add(MyCookie2);
}
}
在 MyCookie2.Value = DataTime.Now.Tostring;中,DataTime编译显示不能通过,小弟刚入门!!