随笔分类 -  C#

摘要:在.NET Reactor6.5中,如果程序里面有调用: Assembly.GetExecutingAssembly().Location 在.NET Reactor6.5启用Native exe file是,不支持,可以采用 Process.GetCurrentProcess().MainModu 阅读全文
posted @ 2022-05-25 12:27 kevin.dai 阅读(131) 评论(0) 推荐(0) 编辑
摘要:把中文乱码字符串转进去,如这样的 /诈骗、涉赌文献总结.xlsx 要转成正常的中文用下面的方法即可解决。 public static string DecFileName(string str) { Encoding utf8 = Encoding.GetEnco 阅读全文
posted @ 2022-05-25 12:06 kevin.dai 阅读(2673) 评论(0) 推荐(0) 编辑
摘要:映射 Mapping HSOAR.Extension里面有很多实现的方法。今天抽空把Mapping写下说明... 不管相互转换的对象是否有存在属性,会把相同的属性的值转换过去 需要用到的类对象方便下面方法调用: public class A { public int PK_ID { get; set 阅读全文
posted @ 2017-06-16 15:47 kevin.dai 编辑
摘要:文件下载,指定默认名Response.AddHeader(”content-type”,”application/x-msdownload”);Response.AddHeader(”Content-Disposition”,”attachment;filename=要下载的文件名.rar”);刷新 阅读全文
posted @ 2015-05-06 19:35 kevin.dai 阅读(10367) 评论(0) 推荐(0) 编辑
摘要:namespace ChangeStringLib //公共类{ public class Class1 { //public void ChangeString(string[] str) //{ // for (int i = 0; i... 阅读全文
posted @ 2015-01-12 23:49 kevin.dai 阅读(168) 评论(0) 推荐(0) 编辑
摘要:namespace ClsLib //公共层{ public delegate void WriteTimeToDevDelegate();//定义类}namespace ClsLib //公共层{ public class Class1 { public ClsLib... 阅读全文
posted @ 2015-01-12 23:13 kevin.dai 阅读(209) 评论(0) 推荐(0) 编辑
摘要:static void Main(string[] args) { int[] test = { 1,33,33,22,44}; Console.WriteLine(Add(test));//也可以这样传 Console.WriteLine(Add(1,2,4,5,6,7)); } //当一个方法中 阅读全文
posted @ 2014-12-28 22:27 kevin.dai 编辑
摘要:static void Main(string[] args) { int test = 100; int s;//申明变明来接收方法返回的值 Console.WriteLine(M1(test,out s));... 阅读全文
posted @ 2014-12-28 22:07 kevin.dai 阅读(319) 评论(0) 推荐(0) 编辑
摘要:class Program { static void Main(string[] args) { int test = 100; M1(ref test); //参数不加REF时,会直接输出100 加了REF会输... 阅读全文
posted @ 2014-12-28 21:55 kevin.dai 阅读(190) 评论(0) 推荐(0) 编辑
摘要:class Program { static void Main(string[] args) { DataBase dt = new Data(); dt.Add(); } } ... 阅读全文
posted @ 2014-12-28 16:37 kevin.dai 阅读(189) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Reflection;using System.Text;namespace ConsoleApplication1{ public del... 阅读全文
posted @ 2014-12-27 09:59 kevin.dai 阅读(379) 评论(0) 推荐(0) 编辑
摘要:在执行Update-Database 提示 ClientConnectionId:f7a284b8-411c-406c-98aa-abaacd37eb88 对象'DF__BaiKe_Tit__IsDel__7720AD13' 依赖于 列'IsDelete'。 由于一个或多个对象访问此列,ALTER 阅读全文
posted @ 2014-07-24 13:57 kevin.dai 阅读(6834) 评论(0) 推荐(0) 编辑
摘要:cobDataBaseType.DataSource = Enum.GetNames(typeof(HSOAR_ORM_Command.C_DatabaseType)); 阅读全文
posted @ 2014-01-09 23:08 kevin.dai 阅读(200) 评论(0) 推荐(0) 编辑
摘要:c# WinForm窗体编程中对窗体程序设置快捷键首先设置:this.KeyPreview = true;//为了使OnKeyDown事件有效(这个设置可以在Form属性中IDE中设置,也可以在代码中设置。) 然后添加如下代码: /// <summary> /// 实现摁下Ctrl+F,进行查找的功能。 /// </summary> /// <param name="e"></param> protected override void OnKeyDown(KeyEventArgs e) { ... 阅读全文
posted @ 2013-06-15 01:01 kevin.dai 阅读(3481) 评论(0) 推荐(0) 编辑
摘要:string strConn = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "\\DeliverGoods.mdb;Jet OLEDB:Database Password=Contact@13310811808"; OleDbConnection conn = new OleDbConnection(strConn); conn.Open(); OleDbDataAdapter da = new OleDbDataAdapter("s 阅读全文
posted @ 2013-05-20 09:21 kevin.dai 阅读(187) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示