
C#
C#知识记录
Happy_to_spend
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C# MVVM界面刷新图片
DGIS.DLIMS.ClientWin.ViewModule.ProductControl LotControlViewModuleprivate DispatcherTimer ContentFresher; ContentFresher = new DispatcherTimer(); ContentFresher.IsEnabled = false; ContentFresher.Interval = TimeSpan.FromSeco...原创 2021-12-03 16:38:51 · 353 阅读 · 0 评论 -
C# 在字符串中截取,替换
1、取字符串的前n个字符(1)string str1=str.Substring(0,n);(2)string str1=str.Remove(i,str.Length-n);2、去掉字符串的前n个字符string str1=str.Remove(0,n);string str1=str.SubString(n);3、从右边开始取n个字符:string str1=str.SubString(str.Length-n);string str1=str.Remove(0,str.Leng..原创 2021-12-03 16:34:08 · 1116 阅读 · 0 评论 -
C# 根据控件NAME名字 操作控件
string name = "label1";object o = this.GetType().GetField(name, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.IgnoreCase).GetValue(this);((Label)o).Text = "hello world!";((Label)thi.原创 2021-12-03 16:32:54 · 1281 阅读 · 0 评论 -
C# WPF基础二 布局嵌套、菜单、工具栏、多窗口
C#进阶 WPF基础二 布局嵌套、菜单、工具栏、多窗口_tufeiax的专栏-CSDN博客转载 2021-12-03 16:32:00 · 803 阅读 · 0 评论 -
C# WPF使用MVVM完成DataGrid数据绑定带全选
WPF使用MVVM完成DataGrid数据绑定带全选_David-CSDN博客转载 2021-12-03 16:21:39 · 809 阅读 · 0 评论 -
wpf C# 解析 Excel
C# WPF 读写Excel文件 - doctorsun - 博客园转载 2021-12-03 16:18:05 · 364 阅读 · 0 评论 -
12.2C#获取应用程序当前文件目录位置(安装路径)
C# Code://B/S系统(Web),获取绝对路径string fileName = string.Format("~/RuleConfigFiles/Campaign_{0}.JSON", CampaignID);var localFile = Utilities.MapPath(fileName);static public string MapPath(string url){if (HttpContext.Current != null)retu...转载 2021-12-03 15:43:29 · 2221 阅读 · 0 评论 -
C#使Decimal类型数据保留N位小数且不进行四舍五入操作
public static class DecimalHelper { public static decimal CutDecimalWithN(decimal d, int n) { string strDecimal = d.ToString(); int index = strDecimal.IndexOf("."); if (index == -1 || strDecimal.Leng.原创 2021-12-03 15:49:37 · 677 阅读 · 0 评论 -
获取文件修改时间
| 属性 | 功能和用途|| ------ | ------ || Attributes| 返回和文件相关的属性值,运用了FileAttributes枚举类型值|| CreationTime| 返回文件的创建时间|| Exists| 检查文件是否存在于给定的目录中|| Extension |返回文件的扩展名|| LastAccessTime |返回文件的上次访问时间|| FullName|返回文件的绝对路径 || LastWriteTime|返回文件的上次写操作时间 || Name...原创 2021-12-03 15:37:41 · 470 阅读 · 0 评论