随笔分类 -  C#

摘要:1.如果数据仅用于展示,或者对数据的获取没有先后要求,可以使用如下线程 private void AutoUpdate_Loaded(object sender, RoutedEventArgs e) {Thread ThreadUpdate = new Thread(Update);} priva 阅读全文
posted @ 2023-04-20 10:03 马玲 阅读(18) 评论(0) 推荐(0) 编辑
摘要:1.根目录 string selectedPath = AppDomain.CurrentDomain.BaseDirectory + "temp\\MaterialFiles"; if (!File.Exists(selectedPath)) { System.IO.Directory.Creat 阅读全文
posted @ 2023-04-19 12:12 马玲 阅读(85) 评论(0) 推荐(0) 编辑
摘要:1.Linq中自带的计算方法:Sql. 。 2.GroupBy 用法 OcSheetNameInfo = OcFlowCheckTableNameConfig .GroupBy(flowBase => flowBase.FunctionTableName) .Select(S => new Flow 阅读全文
posted @ 2021-03-09 14:52 马玲 阅读(94) 评论(0) 推荐(0) 编辑
摘要:public static bool IsNumber(string s) { if (string.IsNullOrWhiteSpace(s)) return false; const string pattern = "^[0-9]*$"; Regex rx = new Regex(patter 阅读全文
posted @ 2021-02-26 16:16 马玲 阅读(841) 评论(0) 推荐(0) 编辑
摘要:1.变量基本属性及反序列化 using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Serialization; na 阅读全文
posted @ 2019-08-31 15:35 马玲 阅读(365) 评论(0) 推荐(0) 编辑
摘要:第一步 (C中)创建 第二步:(A中)声明、绑定 第三步:(B中)触发 方法 第三步:(A中)绑定的方法 阅读全文
posted @ 2019-08-31 15:33 马玲 阅读(159) 评论(0) 推荐(0) 编辑
摘要:1.创建 2.添加数据 阅读全文
posted @ 2019-08-31 15:31 马玲 阅读(265) 评论(0) 推荐(0) 编辑
摘要:?.表示如果不为空LoginUserCode = s.Element("LoginUserCode") != null ? s.Element("LoginUserCode").Value:string.Empty,>> LoginUserCode = s.Element("LoginUserCod 阅读全文
posted @ 2019-08-31 15:21 马玲 阅读(128) 评论(0) 推荐(0) 编辑
摘要:从字典(DicRoleForScope)中查询对应(role)的值再赋值给其他变量( DicSelectedRoleForScope) Dictionary<string, object> dic = DicRoleForScope.Where(s => s.Value.ToString().Con 阅读全文
posted @ 2019-08-31 15:10 马玲 阅读(251) 评论(0) 推荐(0) 编辑
摘要:数据处理 1、保留两位小数 = float.Parse(数据).ToString("F2") //不准确 例如9.57转换后变为9.60 四舍五入 Math.Round(变量, 位数, MidpointRounding.AwayFromZero).ToString() 2、numeric(18, 2 阅读全文
posted @ 2018-11-27 21:38 马玲 阅读(231) 评论(0) 推荐(0) 编辑
摘要:一 . hashTable 1.引用 using System.Collections; 2.声明 Hashtable ht = new Hashtable(); 3.添加值 ht.Add(key,value); key 唯一 string keytxt = de.Key.ToString() st 阅读全文
posted @ 2018-10-30 20:18 马玲 阅读(2797) 评论(0) 推荐(0) 编辑
摘要:1.App.config 文件中定义 <!--记忆语言--> <appSettings> <add key="languageRemember" value="2052" /> </appSettings> 2.关闭时保存本次登机的语言选择 // 记忆退出时的语言类型 Communication.C 阅读全文
posted @ 2018-02-05 13:20 马玲 阅读(280) 评论(0) 推荐(0) 编辑
摘要:1. 根据地址打开文件 AppDomain.CurrentDomain.BaseDirectory Application.StartupPath // 根路径 :即进入到项目的Debug层 System.Diagnostics.Process.Start(@"Help\操作说明.docx"); / 阅读全文
posted @ 2018-01-18 16:58 马玲 阅读(4818) 评论(0) 推荐(0) 编辑

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