07 2020 档案
摘要:1.引用AutoMapper包 2.定义两个实体类 public class ModelA { public string UserId { get; set; } public string Remark { get; set; } } public class ModelB { public s
阅读全文
摘要:1.安装NLog、NLog.Config包 2.添加日志类 public class LogFactory { public static Logger log; private string filename; /// <summary> /// 日志类 /// </summary> /// <p
阅读全文
摘要:1引用 using System.IO;2.代码实现 var path = Directory.GetCurrentDirectory(); // 获得运行文件路径 // var path2 = System.Environment.CurrentDirectory; // 获得运行文件路径 //
阅读全文
摘要:1.设置Combox属性: DropDownStyle:DropDown 2.添加TextUpdate事件 3.下列为Name = cb_material 的 combox 控件 private void cb_material_TextUpdate(object sender, EventArgs
阅读全文
摘要:1.这里用CellMouseClick鼠标点击事件 private void DataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { //if (e.Button == MouseButtons.
阅读全文
摘要:下面是简单例子 1引用Mapster.dll包 2.初始化,设置映射规则 3.下面有两个实体 ModelA 、ModelB class ModelA{ public string UserId{get;set;} public string Remark{get;set;} } class Mode
阅读全文
摘要:1.网上下载Spire.pdf.dll和Spire.License.dll 文件 2.程序引用 3.定义一个方法执行 public void pdftoWord(){ var path = "..."; // pdf文件路径 var savepath = "..."; // 存储路径+文件名称+。d
阅读全文
摘要:1.网上下载WinSw.NET4.exe 配置文件内: <configuration> <!-- ID of the service. It should be unique accross the Windows system--> <!-- id,name,修改成对应服务的名称--> <id>S
阅读全文
摘要:解决跨线程操作控件 - 可使用委托方法 解决方法: public void SetlableText(string str,int i) { label1.Text = str + i; } private void btnsearch_Click(object sender, EventArgs
阅读全文
摘要:x.ToString("0.##") 与 x.ToString("0.00")的不同 static void Main(string[] args) { decimal a = 6.157800M; decimal b = 6.12M; decimal c = 6.1570M; decimal d
阅读全文
摘要:DataGridView列增加单选按钮,并设置被选中 1.DataGridView新增列时,设置属性 “ColumnType” = DataGridViewCheckBoxColumn 2.可使用CellContentClick事件 if (this.data.Columns[e.ColumnInd
阅读全文
摘要:DataGridView自动添加序号 DataGridView找到RowPostPaint事件 private void dg_item_info_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e) { SetDataGr
阅读全文

浙公网安备 33010602011771号