上一页 1 2 3 4 5 6 7 ··· 16 下一页
  2020年2月25日
摘要: 1. .net简介: .net分为.net平台及.net Framework 2..NET作用 2.转义与@ 3.类型转换 1) 隐式转换 2)显式类型转换 (待转换的目标类型)原始值 阅读全文
posted @ 2020-02-25 13:10 Tanqurey 阅读(109) 评论(0) 推荐(0) 编辑
  2020年2月24日
摘要: 1、字符串 字符串可认为是个字符数组, 但实际上是一个对象 using System; namespace Demo { class Program { static void Main() { string str = "1kc02e3c2de43t"; string str2 = "1kc02e 阅读全文
posted @ 2020-02-24 11:21 Tanqurey 阅读(119) 评论(0) 推荐(0) 编辑
  2020年2月23日
摘要: 1.右键项目目录,属性,可修改程序集名称及命名空间 这个节约方案中只能有一个Main方法 using System; namespace Demo { class Program { static void Main(string[] args) { // 使用类 // Demo.Test.Stud 阅读全文
posted @ 2020-02-23 19:17 Tanqurey 阅读(139) 评论(0) 推荐(0) 编辑
  2020年2月22日
摘要: 1、第一个C#程序 打开vs,新建项目,选择控制台应用(.Net Framework) 解决方案可包括多个子项目 在解决方案资源管理器中右键 点击属性,可修改其名称及框架版本 1)properties 设置目录,内含AssemblyInfo.cs用于说明项目信息 2) 引用 包含一些我们引用的库 A 阅读全文
posted @ 2020-02-22 21:47 Tanqurey 阅读(110) 评论(0) 推荐(0) 编辑
  2020年2月18日
摘要: 1、Model常用属性讲解 using System; using System.ComponentModel.DataAnnotations; namespace MVCStudy2.Models { public class Student { [Required(ErrorMessage = 阅读全文
posted @ 2020-02-18 17:03 Tanqurey 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 1、剃须刀模板razor的使用 1)混编 循环语法 @model List<MVCStudy.Models.Student> @{ ViewBag.Title = "List"; } <h2>List</h2> <!--循环遍历数组内容 c#与HTML混编--> <ul> @foreach (var 阅读全文
posted @ 2020-02-18 12:11 Tanqurey 阅读(147) 评论(0) 推荐(0) 编辑
  2020年2月16日
摘要: 1、ActionResult ActionResult是一个父类, 子类包括了我们熟知的 ViewResult 返回相应的视图 ContentResult 返回字符串 RedirectResult( return Redirect(url:xxxx)) 重定向 RedirectToRouteResu 阅读全文
posted @ 2020-02-16 20:15 Tanqurey 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 1、View -> Controller的数据通信 1) 通过url查询字符串 public ActionResult Index(string user) { return Content(user); } 2)通过post方式传递 1 ViewBag.Title = "ShowForm"; 2 阅读全文
posted @ 2020-02-16 11:31 Tanqurey 阅读(128) 评论(0) 推荐(0) 编辑
  2020年2月15日
摘要: 1、cookie 继续讲解MVC的内置对象cookie 相对不安全 1)保存cookie public ActionResult Index() { // 设置cookie以及过期时间 Response.Cookies.Add(new HttpCookie(name: "userId") { Val 阅读全文
posted @ 2020-02-15 13:35 Tanqurey 阅读(135) 评论(0) 推荐(0) 编辑
  2020年2月14日
摘要: 1、新建项目 点击创建新项目,选择ASP.NET web应用程序,对项目进行命名后点击创建。 截图如下: 取消勾选HTTPS配置 可选择空 + mvc 或直接选定MVC 2、目录结构分析 1) App_Start 配置文件夹。 BundleConfig.cs 打包器(css,js等) // Scri 阅读全文
posted @ 2020-02-14 10:06 Tanqurey 阅读(158) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 16 下一页