上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 28 下一页
摘要: 说明:cookie常用于数据保存 1 使用 //创建cookie Response.cookies["yk"].value ="xyxtl"; //设置过期时间 如果不设置cookie只存在内存中,无法实现长期保存 Response.cookies["yk"].Expires = DateTime. 阅读全文
posted @ 2017-06-17 09:22 逍遥小天狼 阅读(212) 评论(0) 推荐(0) 编辑
摘要: Request 1 Request.UrlReferrer 获取请求的来源 2 Request.UserHostAddress 获取访问者的IP地址 3 Request.Cookies 获取浏览器发送过来的浏览器端cookie值 4 Request.MapPath() 将虚拟路径转化为磁盘的物理路径 阅读全文
posted @ 2017-06-16 16:49 逍遥小天狼 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 说明:实际企业中开发分工是很明确,往往程序员根据美工提供的UI界面进行后台代码的编写. 1.1 原始HTML页面 1.2 使用aspx进行修改 这里使用到了三层架构 using System; using System.Collections.Generic; using System.Config 阅读全文
posted @ 2017-06-16 15:28 逍遥小天狼 阅读(228) 评论(0) 推荐(0) 编辑
摘要: WebForm成功之处在于:实现的代码后置,和asp相比实现了html代码和C#代码分离.但 aspx和aspx.cs之间的强耦合和性能方面(特别是服务器控件)做的不是很好. 参照步步为营-68完成相同功能的小例子 1 实现自增 1.1 通过客户端控件 <%@ Page Language="C#" 阅读全文
posted @ 2017-06-15 14:56 逍遥小天狼 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 1 原有图片添加水印 1.1 封装一个类,用于获取文件路径 using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; namespace _06_图片处理 阅读全文
posted @ 2017-06-14 22:54 逍遥小天狼 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 大文件的上传一般通过FTP协议,而一般小的文件可以通过http协议来完成 1 通过asp.net 完成图片的上传 1.1 创建html页面 注意:1 method="post" ;2 enctype="multipart/form-data"; 3 <input type="file" /> <!D 阅读全文
posted @ 2017-06-14 17:27 逍遥小天狼 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 作用:进一步将HTML代码和C#代码进行解耦 1.1 引用程序集(RazorEngine.dll,System.Web.Razor.dll) 1.1.1 可以从http://razorengine.codeplex.com/ 上下载 1.1.2 也可以NuGet程序包安装(建议使用第一种,因为这个安 阅读全文
posted @ 2017-06-12 20:21 逍遥小天狼 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 1 加法计算器 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; namespace _01加法计算器 { /// <summary> /// 阅读全文
posted @ 2017-06-11 21:05 逍遥小天狼 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 说明:服务器和浏览器之间通信大致通过:连接->请求->处理->响应等过程 1 创建服务器(form应用程序) 1.1 首先需要两个对象 Request 和 Response using System; using System.Collections.Generic; using System.IO 阅读全文
posted @ 2017-06-11 09:25 逍遥小天狼 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 1.0 版本 1.1 服务器端 using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Sockets; using System.Text; usin 阅读全文
posted @ 2017-05-30 17:18 逍遥小天狼 阅读(192) 评论(0) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 28 下一页