随笔分类 -  C#.Net & MVC

1 2 3 4 5 ··· 7 下一页
摘要:using System; using System.Collections.Generic; using System.Linq; namespace ConsoleApp1 { class Program { static void Main(string[] args) { /* 贪心算法(集 阅读全文
posted @ 2021-02-20 09:01 深南大道 阅读(464) 评论(0) 推荐(0) 编辑
摘要:using System; namespace ConsoleApp1 { class Program { static void Main(string[] args) { /* 贪婪算法-背包问题 背包问题(Knapsack problem)是一种组合优化的NP完全问题。 问题可以描述为:给定一 阅读全文
posted @ 2021-02-20 08:59 深南大道 阅读(686) 评论(0) 推荐(0) 编辑
摘要:using System; namespace ConsoleApp1 { class Program { static void Main(string[] args) { /* 折半搜索,也称二分查找算法、二分搜索,是一种在有序数组中查找某一特定元素的搜索算法。 A 搜素过程从数组的中间元素开始 阅读全文
posted @ 2021-02-19 16:08 深南大道 阅读(210) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Data.SqlClient; using System.Col 阅读全文
posted @ 2021-02-19 14:42 深南大道 阅读(1350) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Concurrent; using System.Diagnostics; using System.Linq; using System.Net; using System.Net.Http; using System. 阅读全文
posted @ 2021-02-19 14:41 深南大道 阅读(562) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Concurrent; using System.Diagnostics; using System.Linq; using System.Net; using System.Net.Http; using System. 阅读全文
posted @ 2021-02-19 14:38 深南大道 阅读(607) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Net.Http; using System.Threading; using System.Threading.Channels; using System.Threading.Tasks; namespace ConsoleApp1 { cl 阅读全文
posted @ 2021-02-19 14:36 深南大道 阅读(2079) 评论(0) 推荐(1) 编辑
摘要:using System; using System.Threading; using System.Threading.Channels; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { static vo 阅读全文
posted @ 2021-02-19 14:35 深南大道 阅读(1185) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Threading.Channels; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { static async Task Main(string[] a 阅读全文
posted @ 2021-02-19 14:33 深南大道 阅读(848) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; namespace ConsoleApp1 { class 阅读全文
posted @ 2021-02-19 14:31 深南大道 阅读(447) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Threading; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { public static async Task Main(string[] arg 阅读全文
posted @ 2021-02-19 14:29 深南大道 阅读(1555) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace 阅读全文
posted @ 2021-02-19 14:28 深南大道 阅读(378) 评论(0) 推荐(1) 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace 阅读全文
posted @ 2021-02-19 14:26 深南大道 阅读(160) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp6 { class Prog 阅读全文
posted @ 2021-02-19 14:24 深南大道 阅读(233) 评论(0) 推荐(0) 编辑
摘要:创建了一个用来测试的Student表: CREATE TABLE [dbo].[Student]( [ID] [int] PRIMARY KEY NOT NULL, [Num] [varchar](10) NULL, [Name] [nvarchar](64) NULL, [Age] [int] N 阅读全文
posted @ 2021-02-19 14:22 深南大道 阅读(537) 评论(0) 推荐(0) 编辑
摘要:/* || Author: jacky || Description: 数据访问基类 */ using System; using System.Data; using System.Linq; using System.Configuration; using System.Collections 阅读全文
posted @ 2021-02-19 14:16 深南大道 编辑
摘要:using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Data.SqlClient; using System.Col 阅读全文
posted @ 2021-02-19 14:14 深南大道 阅读(529) 评论(0) 推荐(0) 编辑
摘要:1.简介 C#中通常使用线程类Thread来进行线程的创建与调度,博主在本文中将分享多年C#开发中遇到的Thread使用陷阱。 Thread调度其实官方文档已经说明很详细了。本文只简单说明,不做深入探讨。 如下代码展示了一个线程的创建与启动 static void Main(string[] args) { Thread thd = new Thread(new ThreadStart(TestT 阅读全文
posted @ 2019-12-19 13:52 深南大道 阅读(6983) 评论(0) 推荐(1) 编辑
摘要:1、简介 虽然ThreadPool、Thread能开启子线程将一些任务交给子线程去承担,但是很多时候,因为某种原因,比如子线程发生异常、或者子线程的业务逻辑不符合我们的预期,那么这个时候我们必须关闭它,而不是让它继续执行,消耗资源.让CPU不在把时间和资源花在没有意义的代码上. 2、主线程取消所有子 阅读全文
posted @ 2019-12-19 13:20 深南大道 阅读(1691) 评论(0) 推荐(0) 编辑
摘要:CLR线程池并不会在CLR初始化时立即建立线程,而是在应用程序要创建线程来运行任务时,线程池才初始化一个线程。 线程池初始化时是没有线程的,线程池里的线程的初始化与其他线程一样,但是在完成任务以后,该线程不会自行销毁,而是以挂起的状态返回到线程池。直到应用程序再次向线程池发出请求时,线程池里挂起的线程就会再度激活执行任务。 这样既节省了建立线程所造成的性能损耗,也可以让多个任务反复重用同一线程,从 阅读全文
posted @ 2019-12-19 13:00 深南大道 阅读(4686) 评论(0) 推荐(0) 编辑

1 2 3 4 5 ··· 7 下一页