技术
📅 2026-05-20
🏷️ 排序
遇到一个这样的面试问题,写一个方法可以针对数字类型进行冒泡排序。
直接手写代码开撸
```csharp
void NumberSort<T>(T[] items) {
var temp = default(T);
for (var i = 0; i < items.Length; i++) {
for (var j = 0; j < items.Length &
阅读全文 →
技术
📅 2026-05-20
🏷️ WPF
WPF内存排序优选方案
阅读全文 →
📅 2025-09-08
🏷️
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using (var bitmap = new Bitmap(4, 2, PixelFormat.Format8bppIndexed))
{
//bitmap.Palette.Entries[0] = Color.R
阅读全文 →
📅 2024-05-23
🏷️
using (var target = new GDI.Bitmap(path))
{
var buffer = target.LockBits(
new GDI.Rectangle(0, 0, target.Width, target.Height),
阅读全文 →
📅 2024-01-03
🏷️
在项目中做一个批量读取bin目录下的所有DLL动态装在到Ioc容器的功能,读取方法使用的 Assembly.LoadFrom(path); 常规情况下使用是没有问题的,但是如果程序依赖的某一个库本身还需要依赖非dotnet生成的非托管DLL,如sqlite的依赖库,使用这个方法就会报错,此为背景。
要解决这个问题最开始想到的方案是直接try catch 包围 Assembly.LoadFrom 语
阅读全文 →