From 813ef35d614236e155c363b79eb4e68afb9afb71 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 28 Nov 2024 21:10:33 +0800 Subject: [PATCH 1/2] t --- ...36\345\200\274\347\261\273\345\236\213.md" | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 "\350\224\241\345\234\243\346\201\251/2024.11.27\350\277\224\345\233\236\345\200\274\347\261\273\345\236\213.md" diff --git "a/\350\224\241\345\234\243\346\201\251/2024.11.27\350\277\224\345\233\236\345\200\274\347\261\273\345\236\213.md" "b/\350\224\241\345\234\243\346\201\251/2024.11.27\350\277\224\345\233\236\345\200\274\347\261\273\345\236\213.md" new file mode 100644 index 0000000..d963893 --- /dev/null +++ "b/\350\224\241\345\234\243\346\201\251/2024.11.27\350\277\224\345\233\236\345\200\274\347\261\273\345\236\213.md" @@ -0,0 +1,47 @@ +using System.Diagnostics; +using Microsoft.AspNetCore.Mvc; +using Blog.Models; + +namespace Blog.Controllers; + +public class BodyController : Controller + { + public string GenStr(){ +// var redG=new Random(); +// int rndNum; +// var list =new List(); +// for (int i = 0; i < 1000; i++) +// { +// rndNum=redG.Next(0,100); +// list.Add(rndNum); +// } +// return list; + + var Gad=Name(); + return Gad; +} + +private string Name(){ + + var str="陈西金安达辅当时规范突然为高科技考虑达萨罗贷款尽快为您"; + + var Rnd=new Random(); + + int ranNum=Rnd.Next(0,str.Length-1); + + var rndStr=str[ranNum]; + + + return rndStr.ToString(); +} +private string Ca(){ + var redG =new Random(); + var str=redG.Next(1,4); + string so=""; + for (int i = 0; i < 3; i++) + { + so+=Name(); + } + return so; +} +} \ No newline at end of file -- Gitee From e405f27a84dc392ecb853772d7daaab5ec45ac60 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 1 Dec 2024 18:45:51 +0800 Subject: [PATCH 2/2] t --- .../2024.11.29\346\270\262\346\237\223.md" | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 "\350\224\241\345\234\243\346\201\251/2024.11.29\346\270\262\346\237\223.md" diff --git "a/\350\224\241\345\234\243\346\201\251/2024.11.29\346\270\262\346\237\223.md" "b/\350\224\241\345\234\243\346\201\251/2024.11.29\346\270\262\346\237\223.md" new file mode 100644 index 0000000..d97a2a5 --- /dev/null +++ "b/\350\224\241\345\234\243\346\201\251/2024.11.29\346\270\262\346\237\223.md" @@ -0,0 +1,92 @@ +# 笔记 +1. 输入标记帮助程序 +```html + + @model RegisterViewModel + +
+ +
+
+ +
+``` +### 列表作业 +```cs +//控制器代码 +using Black.Models; +using Microsoft.AspNetCore.Mvc; + +namespace Black.Controllers; + +public class BlueController:Controller +{ + public IActionResult Index() + { + return View(Db.Blue); + } + +} +//Models中Blue代码 +namespace Black.Models; +public class Blue{ + public int Id{get;set;} + public string Title{get;set;}=null!; + public string Content{get;set;}=null!; + public string Author{get;set;}=null!; +} + +//Models中Db代码 +namespace Black.Models; + + +public static class Db{ + public static List Blue{get;set;} + + static Db() + { + Blue=new List(); + + for(int i=0;i<10;i++){ + var tmp=new Blue{ + Id=i+1, + Title="周五", + Content="出去玩", + Author="小小" + }; + Blue.Add(tmp); + } + } +} +//Views中Index代码 +@model List; +
+ +
+ + + + + + + + + + + + @foreach(var black in @Model) + { + + + + + + + + } + +
Id标题内容作者操作
@black.Id@black.Title@black.Content@black.Author + + +
+``` \ No newline at end of file -- Gitee