ASP.NET操作Cookie
//创建
HttpCookie cookie = new HttpCookie("user","111");//创建Cookie
cookie Expires = DateTime.Now.Add(15);//设置过期时间
Response.Cookies.Add(cookie);//存入客户端
我们取出Cookie值也很简单
string value = Request.Cookies["user"].value;
有时候我们想在一个Cookie中储存多个信息,那也没有问题。比如我们在名为user的cookie下加多个信息
HttpCookie cookie = new HttpCookie("user");
cookie.Values.Add("name","222");
cookie.Values.Add("pwd","333");
cookie.Values.Add("member","admin");
Response.Cookies.Add(cookie);
从客户端获取取信息也一样简单
HttpCookie cookie = Request.Cookies["user"];
value1 = cookies.Values["name"];
value2 = cookies.Values["pwd"];
相关文档:
常用函数系列:
public static string Get_ClientIP() 得到客户端IP
public static string Get_CMac(string IP) 得到客户端 CMac 地址
public static string RequestF(string xPName,string xPType,int xLenDef) 安全接收数据系列
public static string Show_Cont(string xStr) 过滤显示字串
public static str ......
我用C# 写的一个Windows应用程序里,用TeeChart实现了一个折线图.
X轴是时间,Y轴是数值,加了个一垂直的CursorTool.
鼠标在图上移动时,垂直的CursorTool会跟着鼠标跑,并触发CursorTool的Change事件.
在CursorTool的Change事件里,
我取出了曲线与垂直的线交点处的,时间值,和数值.
我写这个Window程序的主要上的是摸 ......
ASP.NET文件下载函数使用是什么情况呢?在你的Page_Load中添加这样的代码:
Page.Response.Clear();
bool success = ResponseFile(Page.Request, Page.Response, "目的文件名称", @"源文件路径", 1024000);
if (!success) Response.Write("下载文件出错!"); Page.Response.End();
ASP.NET文件下载函数代码为:
......
string destFileName = "ok.txt";
destFileName = Server.MapPath(".") + "\\"+destFileName;
destFileName = Server.UrlDecode(destFileName);
&nbs ......
首先建立一个c/s程序 在新建的form上加入一个浏览器控件和一个时间控件浏览器控件能转向你要执行的页面而时间控件控制多少时间后关闭你要执行的页面然后设置form的visible为false form的状态为最小化 目的是将整个执行的页面程序包在form的浏览器控件中执行而form会被隐藏 这样做神不知鬼不觉。最后用windows的计划任务每天 ......