![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C#
牧歌ing
这个作者很懒,什么都没留下…
展开
-
Visual Studio在项目中添加快捷方式的文件
需求:多个项目引用相同的文件或资源可以用添加文件的快捷方式解决Visual Studio 2019 演示右键项目->添加->现有项-选择要添加的文件->点击添加按钮->选择添加为链接原创 2021-04-22 15:44:25 · 294 阅读 · 0 评论 -
List<Object>序列化成xml时根节点是ArrayOfObject,自定义根节点名称解决方案
using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Xml;using System.Xml.Serialization;namespace ConsoleApp1{ [XmlType("department")] public class D原创 2021-04-22 15:21:56 · 728 阅读 · 0 评论 -
ASP.NET Core Web MVC创建一个项目(二)
1.添加数据模型类在Models文件夹中建一个UserInfo.csusing System;using System.Collections.Generic;using System.Linq;using System.Threading.Tasks;namespace MvcUser.Models{ public class UserInfo { public int id { get; set; } public string name原创 2020-09-11 15:20:37 · 378 阅读 · 0 评论 -
ASP.NET Core Web MVC创建一个项目(一)
1.选择ASP.NETCore Web 应用程序,然后进行下一步2.配置项目名称,然后创建3.选择Web 应用程序(模型视图控制器),然后创建4.点击IIS Express运行项目5.以下是项目运行成功的界面原创 2020-09-09 17:44:01 · 291 阅读 · 0 评论 -
C# Parallel.For 的使用
Parallel.For是微软提供的一个简单的并行计算的方法,这篇文章主要有两个目的其一,介绍一下Parallel.For的使用其二,和串行进行比较1.现在来看看不访问相同资源时,Parallel.For和串行的效率如何,以下是代码using System;using System.Threading.Tasks;namespace AppCode{ class ...原创 2019-12-11 16:53:06 · 9409 阅读 · 0 评论 -
Parallel.Invoke的用法
using System;using System.Threading.Tasks;namespace AppCode{ class Program { static object obj = new object(); static long lvalue = 0; static void Main(string[] ar...原创 2019-12-10 18:24:05 · 437 阅读 · 0 评论 -
C#并行计算 Parallel.Invoke 和简单串行性能对比
1.为了直观,选用三个方法三个方法代码逻辑一致,计算次数一致using System;using System.Threading.Tasks;namespace AppCode{ class Program { static void Main(string[] args) { System.Diagnosti...原创 2019-12-06 17:17:29 · 686 阅读 · 0 评论 -
C# 建一个Windows 服务 定时发邮件
1.打开VS建一个Windows 服务2.下一步,填好项目名称和项目保存的地址3.创建之后,右击、选择添加安装程序4.添加安装程序之后会出现‘serviceInstaller1’=>在此控件上右键=>选择属性=>更改服务名、服务描述、服务显示名。5.写代码using System;using System.Collections.Ge...原创 2019-12-02 17:36:51 · 671 阅读 · 0 评论 -
.net 值班表 有五个人{A,B,C,D,E} 一人值班一天, A只要到星期一值班,其他四个人除了星期一以外每天循环值班,循环一年
public static void aa() { List<string> users = new List<string> { "B", "C", "D", "E" }; List<string> usersTemp = new List<string>(); ...原创 2019-11-30 10:44:23 · 434 阅读 · 0 评论 -
正则匹配中文
正则匹配中文 string ch = "fds666ddd顶顶顶顶"; MatchesChinese(ch); public static string MatchesChinese(string ch) { string strRegex = @"[\u4E00-\u9FFF]+"; ...原创 2019-11-26 10:07:21 · 308 阅读 · 3 评论