摘要: 前言今天需要替换nginx虚拟主机access log的日志格式,之前是main,加了$request_time和$upstream_response_time之后重命名为php-fpm-main,因此我需要将所有的虚拟主机文件中的main替换成php-fpm-main,手动实在是太麻烦了,这个时候sed功能就可以使用了sed批量替换首先,grep查看一下需要替换的内容grep查找sed替换sed -i "s/oldstring/newstring/g" `grep 'oldstring' -rl $dir`操作实例: 阅读全文
posted @ 2013-04-11 11:08 java程序员填空 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 创建HttpCookie cookie = new HttpCookie("name"); cookie.Value = HttpUtility.UrlDecode("猪刚烈", Encoding.GetEncoding("UTF-8")); //HttpUtility 这个是用来编码解码的 cookie.Expires = DateTime.Now.AddDays(1); //设置过期时间 Response.Cookies.Add(cookie);读取TextBox1.Text = HttpUtility.UrlDecode(Htt 阅读全文
posted @ 2013-04-11 07:53 java程序员填空 阅读(96) 评论(0) 推荐(0) 编辑