Fivee

导航

随笔分类 -  .net开发

还好这次不烫了
MethodInfo.Invoke()
摘要:反射调用时,必须传递所有参数, 无论是否有默认参数。 public class InvokeTarget { public static void Invoke1(int a) { } public static void Invoke2(Action<int> a, int b = 0) { } 阅读全文

posted @ 2020-11-17 15:49 Fivee 阅读(1028) 评论(0) 推荐(0)

无法找到公共类型
摘要:记录一下。目前只遇到过因为编译失败引起这个问题。 例如被引用文件的framework版本大于引用者的版本。 阅读全文

posted @ 2020-01-14 12:39 Fivee 阅读(130) 评论(0) 推荐(0)

.net TypeConverter
摘要:在进行文本解析时,读取一些不规则的自定结构时,用typeConvert是一个非常好的手段. 1 class StringArrayConvert : TypeConverter 2 { 3 public override object ConvertFrom(ITypeDescriptorConte 阅读全文

posted @ 2020-01-13 14:56 Fivee 阅读(356) 评论(0) 推荐(0)

C# 切分图片
摘要:public void Slice() { // 图片路径 var file = "F;/aaa.png"; // 水平切分 int horizontal = 4; // 纵向切分 int vertical = 4; for (int i = 0; i < horizontal * vertical 阅读全文

posted @ 2018-06-27 17:48 Fivee 阅读(300) 评论(0) 推荐(0)