- 博客(41)
- 资源 (8)
- 收藏
- 关注
原创 企业微信推送消息
企业微信服务接口文档:https://developer.work.weixin.qq.com/document/path/90664。需求每天向企业微信中的部分用户推送消息。
2023-03-23 15:57:41
958
原创 Ado.net
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.SqlClient;using System.Data;namespace DAL{ /// <summary> /// DBHelper 的摘要说明 /// </summary> public class DBHelper : Syst
2022-04-26 23:34:35
277
原创 hosts无法编辑,没有编辑权限
1:找到路径C:\Windows\System32\drivers\etc2:找到hosts文件,右键属性–>安全–>高级在这里插入图片描述
2022-04-25 21:15:59
463
原创 navicat 中写sql
-- 01 创建数据库 CREATE DATABASE HH DEFAULT CHARACTER set utf8mb4; -- 02 使用study 数据库 USE study; -- 03 查看study 中的表 SHOW TABLES; -- 04 创建一个表 CREATE TABLE `course`( `id` INT NOT NULL PRIMARY KEY, `name` VARCHAR(20) NOT NULL, `price` VARCHAR(6)
2021-04-09 01:56:56
516
原创 MySql 安装64位
下载地址: https://dev.mysql.com/downloads/mysql/Windows(x86,64位),ZIP存档,需要手动配置。Windows(x86,32位),MSI安装程序 XP下可以直接运行安装,直接next1:解压zip,创建Data,文件夹,和MySQL文件夹,Data文件夹存放数据,。MySQL 存放路径2:创建my.ini,文件 ,配置my.ini 文件[mysqld]#设置3306端口port=3306#设置mysql安装目录basedir=D:\my
2021-04-08 22:45:47
1780
原创 EF 中db.Database.SqlQuery<T>的用法
第一种: public ActionResult Index() { using (MyContext db=new MyContext()) { Classes c = new Classes(); string sql = string.Format("select * from Class where Id={0}",1); IList&l
2020-09-10 10:25:04
3616
原创 配置AutoFac(IOC容器)
基于接口编程:IOC 概念,之前我们写程序的时候,都是程序员自己new的,当项目大了之后的坏处:1)各模块之间耦合严重2)想要跟换为其它类的时候麻烦3)有的程序员只关心,给我一个实现****接口的类,它不想关心这个类是怎么来的因此就诞生了IOC容器,使用IOC 容器后,不再是由程序员自己new 对象,而是有框架帮你new对象现在IOC 有很多:Spring.Net,Unity,Castle,AutoFac等,目前最火的就是AutoFac。使用IOC 编程的时候,一般都是建议接口编程,也就是把方
2020-09-04 14:52:41
614
原创 MVC中的DefaultModelBinder类(全角转换)
DefaultModelBinder类的作用:自动截取空格和进行全角转换使用方法:1:安装程序集Install-PackAge Microsoft.AspNet.Mvc2写一个类,继承自DefaultModelBinder类,在里面写实现逻辑的方法(全角转半角,空格的去除)3:在Global中添加using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Thr
2020-09-03 10:38:27
280
原创 log4Net的配置 与 自定义一个异常过滤器来实现使用log4Net 以及四种过滤器Filter的介绍
1:安装程序集 Install-Package Log4NET2:在Web.config 中添加节点<configuration> 配置节点 <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> </configSections> </configuration&
2020-09-01 15:36:37
578
原创 EF 架构(UI+server)
EO,DTO,ViewModel 区别1:EO(Entity Object,实体对象),就是EF中的实体类,对EO的操作会对数据库产生影响,EO不应该传递到其它层2:DTO(Data Transfer Object,数据传输对象),用于各个层之间传递数据的普通类,DTO 有那些属性取决于其它层要什么数据,DTO 一般是“扁平类”,也就是没有关联属性,都是普通类型属性,一些复杂项目中,数据访问层(DAL)和业务逻辑层(BLL)直接传递一个DTO类,UI和BLL层之间用一个新的DTO类,简单的项目公用一个D
2020-09-01 13:42:19
521
原创 EF 中 一对多,多对多之间的配置
1:一对多配置student表中ClassId 是 Class表的Id public class StudentEF { public int Id { set; get; } public string SName { set; get; } public int ClassId { get; set; } //最好对应 ClassId 去掉Id就是Class 最好对应上 /
2020-08-24 17:06:32
1202
原创 EF FluentAPI 配置方法
//1:创建数据库和表 //2:安装EF,配置连接字符串 //3:创建实体类,类映射数据的表 namespace WebApplication4{ public class Class { public int Id { get; set; } public string ClassName { get; set; } }} //4:创建一个xxxConfig的文件夹,存储xxxConfig的类,用来配...
2020-08-21 13:29:54
446
原创 EF简单 DataAnnotation实体配置
DataAnnotation 这种配置方法,比较方便,但是耦合度比较高1:数据库中建表T_Person,有 Id(主键,自动增长),Name,CreateDateTime字段。2:创建Person类[Table("T_Person")] //因为类名和表名不一样,所以要使用Table标注public class Person{ public long Id{get;set;} [Column("Name")] public string SName{ get;set
2020-08-21 10:23:47
420
原创 MVC中用 FormsAuthentication.SetAuthCookie()来做身份验证
1:验证用户登录成功,登录成功之后写入cookie中 [HttpPost] public ActionResult ChekLogin(string user,string pwd) { //判断用户名与密码 if (user == "admin" && pwd =="123") { //为当前用户提供一个身份验证票据,并将该票据添加到Cookie,
2020-08-18 17:01:18
501
原创 MVC 中控制器的返回值
//1:输出简单的文本内容 public ActionResult ContentText() { string content = "<h1>欢迎你的到来</h1>"; return Content(content); } //2:输出JSON 字符串 public ActionResult JsonTest() {...
2020-08-18 15:38:26
256
原创 Npoi 导出功能
<button id=btn>导出</button><script> $("#btn").click(function () { Download("本科生课程", $("#select_BenKeShengKeCheng option:selected").text(), $("#key_BenKeShengKeCheng").val()); }); function Download(module,
2020-07-28 17:51:24
184
原创 jquery插件fancybox的使用
<html><head> <meta name="viewport" content="width=device-width" /> <title>Fancy</title> <link href="~/Content/fancyBox/jquery.fancybox.css" rel="stylesheet" /> </head><body> <div>.
2020-07-28 16:01:37
565
原创 bootstrap-table
html><head> <meta name="viewport" content="width=device-width" /> <title>Tab</title> <!--css样式--> <link href="~/Content/picker/sample in bootstrap v2/bootstrap/css/bootstrap.min.css" rel="stylesheet" /&
2020-07-28 14:39:49
172
原创 bootstrap中的Modal
<html><head> <meta name="viewport" content="width=device-width" /> <title>Modial</title> <link href="~/Content/picker/sample in bootstrap v2/bootstrap/css/bootstrap.min.css" rel="stylesheet" /> <scri.
2020-07-27 13:22:34
357
原创 bootstrap 中datetimepicker的使用方法
@{ Layout = null;}<!DOCTYPE html><html><head> //首先引入文件 注意顺序 <meta name="viewport" content="width=device-width" /> <title>Picker</title> <script src="~/Content/picker/sample in bootstrap v2/jqu
2020-07-27 11:17:13
546
原创 IIS配置以及发布
1:安装IIS2:编辑权限: 添加账户 NETWORK SERVICE ,IIS_IUSRS,添加这两个账户,外面的才可访问的到
2020-06-22 06:43:00
376
原创 Git讲解
Get 服务端的安装包 : https://bonobogitserver.com 是一个基于mvc 的网站应用程序,部署到IIS上1 Get客户端下载地址: https://git-scm.com/downloads2:下载客户端图形管理管理工具: https://tortoisegit.org/download 客户端图形管理工具 TortoiseGit ,汉化包...
2020-06-22 05:57:56
135
原创 AJax的使用
<from id='form1'><input type='text' name='user' id='user' /><br/><input type='password' name='pwd' id='pwd' /><br/><input type='button' id='btn' name='btn'/><...
2020-06-06 09:57:23
78
原创 控制器的介绍
中转作用: 1:承上启下,根据用户输入,执行响应行为(动作方法) 2:在行为中调用模型的业务逻辑,返回给用户结果(视图)中介角色: 1:分离视图和模型,让视图和模型各司其职,控制器赋值二者交互 2:只负责数据传送,不负责处理动作方法的映射<input type="text" name="className" >参数名与name的值一样public Act...
2019-11-05 14:39:36
252
原创 Razor视图 中的一些知识
@using System.Collections.Generic //在视图中引入命名空间 @ViewData["info"] // 使用ViewData[]@("欢迎使用Razor视图") // 输出 <p>12345@@qq.com</p> // @@转义强类型对象的使用@model MvcApplication1.Models...
2019-11-05 10:28:59
231
原创 dynamic动态类型的理解
动态类型的特点:出现时机:.Net4.0之后引入新的关键字dynamic,用来定义动态类型使用特点:调用动态类型时不做"编译"检查,而在程序运行时查找,如果成员存在且参数正确,就正常运行Asp.net Mvc 中的ViewBag,就是一个动态的类if(ViewBag.Student!=nuu){ foreach(model.Studen st in ViewBag.Student) ...
2019-11-01 09:20:30
771
原创 什么叫匿名类
匿名类的特点:1:将一组只读属性封装到单个对象中,不需要预先定义一个类型2:类型名有编译器产生,每个属性的类型由编辑器推断出来 static void Main(string[] args) { var student =new {name="张三",Age=20}; Console.WriteLine(student.na...
2019-11-01 08:51:22
1582
原创 可选参数与命名参数
为何要用可选参数:方法参数过多,调用显得麻烦,在方法调用时不必传递所有的参数,可选参数又成为默认参数 static void Main(string[] args) { Pinfo("张三");//全部使用默认参数 Pinfo("张三", 18);//使用一个默认参数 Pinfo("zhang",25,"男...
2019-11-01 08:35:22
147
原创 WebApi 中启用Session
首先在Global文件中添加一个方法public class WebApiApplication : System.Web.HttpApplication { protected void Application_Start() { AreaRegistration.RegisterAllAreas(); ...
2019-10-31 08:51:24
397
原创 WebApi 跨域
1:首先在webconfig 中添加<system.webServer> <httpProtocol> <customHeaders> <!--响应类型(值为逗号分隔的一个字符串,表明服务器支持的所有跨域请求方法)--> <add name="Access-Control-Allow-Methods" va...
2019-10-31 08:32:16
117
原创 WebApi 中的特性路由
如果http 请求的的方法相同(比如都是post),并且请求的参数也相同,这时候有点不好办了,此时我们采用特性路由特性路由的目的是为了解决我们公共路由模板引擎解决不了的问题。一个Action 定义了特性路由之后,就能通过特性路由上的路由规则找到1:在用特性路由之前先更改WebApiConfigpublic static class WebApiConfig { p...
2019-10-31 07:54:41
515
原创 WebApi 路由规则
public static class WebApiConfig { public static void Register(HttpConfiguration config) { config.Routes.MapHttpRoute( name: "DefaultApi", // 路由名称 ...
2019-10-31 07:16:49
338
原创 HttpClient掉用WebApi 添加一个实体
1:HttpClient 客户端public ActionResult AddProduct(Models.Product pro) { // 1:创建一个Uri类 Uri uri = new Uri("http://localhost:2694"); //2:创建一个HttpClient客户端对象,H...
2019-10-30 12:19:30
102
原创 HttpClient 调用WebApi 查询
1:首先模拟创建一个客户 MVCpublic class HomeController : Controller { // // GET: /Home/ public ActionResult Index() { // 1:创建一个Uri类 Uri uri = new U...
2019-10-30 11:34:43
229
原创 WebApi 中Post的3种传参
1:基本传参,只有一个参数 <script> function Demo1() { $.ajax({ url: "/api/Product", type: "post", data: {"":"absf"}, ...
2019-10-30 10:31:17
1106
原创 WebApi 中Get 的3种基本传参
1:Get 的基本传参<script src="~/Scripts/jquery-1.7.1.min.js"></script> <script> function Demo1() { $.ajax({ url: "/api/Product", t...
2019-10-30 08:56:39
1053
.net core 3.1 运行环境包
2022-05-31
mysql-community
2022-05-31
Visio流程使用工具
2022-05-31
svn 安装包包含中文语言包
2022-05-31
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人