随笔分类 - C#知识点
摘要:public List<BsonDocument> GetCollectionByBillCode(string BillCode) { List<BsonDocument> list = new List<BsonDocument>(); // 根据集合名称获取集合 string collecti
        阅读全文
                
摘要:List<BsonDocument> bsonList = new List<BsonDocument>();List<BsonDocument> list= new List<BsonDocument>(); // 合并bsonList = bsonList.Concat(list).ToList
        阅读全文
                
摘要:https://zhidao.baidu.com/question/537686608.html 1、num.ToString("#0.00"); //点后面几个0就保留几位 2、num.ToString("f2"); //fN 保留N位,四舍五入,"F","f" 不区分大小写 3、Math.Rou
        阅读全文
                
摘要:int recordingCycle = int.Parse(ConfigurationManager.AppSettings["recordingCycle"]);	// = 1string collectionName = ConfigurationManager.AppSettings["co
        阅读全文
                
摘要:strList = strList.OrderBy(o => double.Parse(o)).ToList(); //数字 listFunc = listFunc.OrderBy(o => o).ToList(); //字母 例子:testList = new List<u>();testList
        阅读全文
                
摘要:1:无法安装程序包“MIcrosoft.Owin.Security 2.0.2”。您正在尝试将此程序包安装到某个将“.NETFramework,Version=v4.:5”作为目标的项目中。https://jingyan.baidu.com/article/546ae1850129af1148f28
        阅读全文
                
摘要:问题:ASP.NetCore 检测到包降级:XXXXXXXXXX 从 1.0.5 降 1.0.4解决方法1:1:工具-nuget管理包-程序管理控制台-选择 项目2:执行 Install-Package XXXXXXXXXX -Version 1.0.5命令即可。 解决方法2(暴力解决法): 找到使
        阅读全文
                
摘要:1、 //GB2312或ASCII转UTF8 public static string getUtf8(string param) { byte[] buffers = Encoding.GetEncoding("GB2312").GetBytes(param); param = Encoding.
        阅读全文
                
摘要:textBox属性 -> 行为 -> Multiline:True 效果类似textArea
        阅读全文
                
摘要:会覆盖已存在文件File.WriteAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "abv.json"), "创建连接字符串开始"); true不会覆盖已存在文件StreamWriter sw = new StreamWrit
        阅读全文
                
摘要:环境问题,.net core 发布时对SDK的依赖是默认最高版本,把本地的SDK升级成最高版本,然后把高于.net core 项目需求版本的其他版本全部卸载,就能正常发布了,发布后也不会报版本错误 或者 不升级到最高版本,严格按照环境要求的版本安装SDK等程序(XingcMis报错是这样解决的)
        阅读全文
                
摘要:第1步:定义一个间隔时间private static readonly TimeSpan Interval = TimeSpan.FromMilliseconds(100); 第2步:线程休眠使用间隔时间Thread.Sleep(Interval);
        阅读全文
                
摘要:利用委托进行异步操作 1:定义一个委托,int是委托的函数的返回值类型,如果是void就写voidpublic delegate int ListenServerDelegate(); 2:创建一个委托,GetServerList是函数ListenServerDelegate listenServe
        阅读全文
                
摘要:方法1:修改注册表(好处在于即使程序需要管理员权限也能正常开启,并显示页面)using Microsoft.Win32; //添加引用->COM,搜索Windows Script Host Object Modeltry{	if (checkBox1.Checked)	{ RegistryKey r
        阅读全文
                
摘要:<appender name="RollingLogFileAppender" ........> ........ <filter type="log4net.Filter.LevelRangeFilter"> <levelMin value="INFO" /> <levelMax value="
        阅读全文
                
摘要:class Program { static void Main(string[] args) { Type t = typeof(Program);//参数为所要使用的函数所在的类的类名。 MethodInfo mt = t.GetMethod("foo"); if (mt == null) { 
        阅读全文
                
摘要:1:项目=>属性=>应用程序=>图标和清单=>清单 选【app.manifest】 2:设置uac 选项<?xml version="1.0" encoding=Mutf-8"?><assembly manifestVension="l.0" xmlns=Murn:schemas-microsoft
        阅读全文
                
摘要:1:用记事本打开你C#项目工程下的.csproj 文件2:搜索找到你的生成类型一行:比如我用的是'Release|x64'生成程序	<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">3:在此行下添加以
        阅读全文
                
摘要:DateTime calcTimeTemp = DateTime.Now(); DateTime endTimeTemp = new DateTime(calcTimeTemp.Year, calcTimeTemp.Month + 1, 1, 23, 59, 59); // 设置下个月1号23:59
        阅读全文
                
 
                    
                
 浙公网安备 33010602011771号
浙公网安备 33010602011771号