摘要: C#实例代码: /// <summary> /// 图片转base64 /// </summary> /// <param name="bmp"></param> /// <returns></returns> private string ImgToByte(Bitmap bmp) { strin 阅读全文
posted @ 2019-05-21 21:27 xiewei123 阅读(1143) 评论(0) 推荐(0) 编辑
摘要: //实例代码: /// <summary> /// 添加节点事件 /// </summary> /// <param name="tnodes"></param> /// <param name="nodeName">父节点名称</param> /// <param name="subNodeNam 阅读全文
posted @ 2019-05-21 21:19 xiewei123 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 1.使用NuGet添加 Spire.Doc 2.使用方式 Document document = new Document(); document.LoadFromFile(documentPath); //参数解释为 pageIndex, pageCount, ImageType Image[] 阅读全文
posted @ 2019-05-21 21:16 xiewei123 阅读(232) 评论(0) 推荐(0) 编辑
摘要: 1.复制指定文件到指定位置: public void AddFile(string sourcefile, string targetfile) { File.Copy(sourcefile, targetfile, true); } 2.获取指定目录下的所有文件夹名称,返回List public 阅读全文
posted @ 2019-05-21 21:09 xiewei123 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 反射为了动态(运行时动态) 原理:读取metadata(?) Assembly assembly = Assembly.Load("TestReflections");//反射的入口 动态加载DLL foreach (Module item in assembly.GetModules()){}// 阅读全文
posted @ 2018-12-23 20:32 xiewei123 阅读(450) 评论(0) 推荐(0) 编辑
摘要: 第一节: 1.委托的声明、实例化和调用(三部曲) //1定义(定义在类里面或者外面(不能再方法里面)) /* * public delegate void MyDelegate1();//无参数 * public delegate void MyDelegate2(int x, int y);//有 阅读全文
posted @ 2018-12-23 20:31 xiewei123 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 1.什么是泛型 泛型是 2.0 版 C# 语言和公共语言运行库 (CLR) 中的一个非常重要的新功能。 我们在编程程序时,经常会遇到功能非常相似的模块,只是它们处理的数据不一样。但我们没有办法,只能分别写多个方法来处理不同的数据类型。这个时候,那么问题来了,有没有一种办法,用同一个方法来处理传入不同 阅读全文
posted @ 2018-12-02 18:13 xiewei123 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 1.通过nuget安装 ManagedDataAccess 2.引用 using Oracle.ManagedDataAccess.Client; 注:最低framework4.0 测试连接: /// <summary> /// 测试数据库连通 /// </summary> public stati 阅读全文
posted @ 2018-09-07 14:42 xiewei123 阅读(714) 评论(0) 推荐(0) 编辑
摘要: 恢复内容开始 收到的工作是将一个ERP的窗体程序改为网页实现,所以就肯定需要弹框来选择(如:物料编码、部门、业务员等等) 本文采取的前段框架是LayUI。 layUI的官网API网址:https://www.layui.com/doc/ 在此只贴出几个关键性的代码: 弹出你显示选择数据的界面 然后你 阅读全文
posted @ 2018-08-31 14:10 xiewei123 阅读(494) 评论(0) 推荐(0) 编辑
摘要: 最近需要对一个文件进行数量的分割,因为数据量庞大,所以就想到了通过写程序来处理。将代码贴出来以备以后使用。 //读取文件的内容 放置于StringBuilder 中 StreamReader sr = new StreamReader(path, Encoding.Default); String 阅读全文
posted @ 2018-08-31 13:44 xiewei123 阅读(398) 评论(0) 推荐(0) 编辑