自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(37)
  • 收藏
  • 关注

原创 操作注册表

注册表注册 public static void SaveReg(string p_Filename, string p_FileTypeName) { RegistryKey _RegKey = Registry.ClassesRoot.OpenSubKey("", true); //打开注册表 RegistryKey _VRPkey = _RegKey.OpenSubKey(p_FileTy.

2021-08-20 10:06:37 98

原创 软考--高项

快速复习:https://me.51cto.com/p/218.html2017年信息系统项目管理师考试题型分析(2017上半年):http://www.cnitpm.com/pm1/43634.html高项是什么?PMP®和高项哪个更好考?:https://www.educity.cn/pmp/2049993.html高项管理工程选择题:http://www.doc88.com/p-2505581459322.html http://www.doc88.com/p-14560828691...

2021-04-09 15:41:58 326

原创 C# XML使用解析

创建XML 示例 读取XML文件 修改XML文件 删除XML文件中的节点内容

2021-03-25 16:53:57 150

原创 C# ListView失去焦点仍然保持选中的Item高亮

private void listView_Validated( object sender, EventArgs e){ if (listView.FocusedItem != null ) { listView.FocusedItem.BackColor = SystemColors.Highlight; listView.FocusedItem.ForeColor = Color.White; }}priv.

2021-03-25 11:39:49 1461

原创 深拷贝与浅拷贝

浅拷贝:引用成员在被拷贝时仅复制源对象中引用成员的地址到新对象中,所以在新对象中对引用成员进行更改会影响到源对象(除对引用成员进行赋值外)。深拷贝:引用成员在拷贝时新建一个引用对象到新对象中,且将源对象中引用对象的成员值复制到新对象的引用对象中,所以在新对象中对引用成员进行更改不会影响源对象。说起来概念也简单,我想大家纠结的是如何实现深拷贝?浅拷贝的实现很简单,调用Object.MemberwiseClone就万事大吉了。在网上找了一个通过序列化实现深拷贝的例子,自己改了改,欢迎大家品头论足。.

2021-03-25 11:35:36 53

原创 C# 将List<string>转换为List<double>

//string转List<double>List<string> strList = new List<string>();strList.Add("100"); strList.Add("500"); strList.Add("700");List<double> douList = strList.ConvertAll(s => Convert.ToDouble(s));string str = "600 650 700";List&.

2021-03-25 11:29:42 2280 1

原创 C# 读取或修改文件后缀

修改excel后缀文件为pdfstring pdfFileName = Path.ChangeExtension("C:\\test.xls", "pdf");

2021-02-20 17:04:31 364

原创 C# ContextMenuStrip

ContextMenuStrip 添加二级菜单选项 ContextMenuStrip cms = new ContextMenuStrip(); int itemsCnt = 0; cms.Items.Add("report-Excel "); cms.Items[itemsCnt].Click += new EventHandler((s1, e1) => ExportExcel()); itemsC

2021-02-20 14:30:30 828

原创 C# TreeView导出到Xml

C# TreeView导出到Xml1. TreeView树图如下:2. 保存代码如下:private void button3_Click(object sender, EventArgs e) { XmlDocument myXmlDoc = new XmlDocument(); XmlDeclaration xmldec = myXmlDoc.CreateXmlDeclaration("1.0", ...

2021-01-12 11:11:17 680

原创 C# TreeView读取Xml

1. Xml文本内容如下:<?xml version="1.0" encoding="UTF-8"?><xml> <Emp id="1" p_id=""> <name>CEO</name> </Emp> <Emp id="2" p_id="1"> <name>CTO</name> </Emp> <Emp id="3" p_id="1"> &l...

2021-01-12 10:34:14 521

原创 C# textbox实时输入值检测

检查textbox实时输入值是否为英文状态下的,分割符与数值(数值可正可负)private void textBoxMarker_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar >= '0' && e.KeyChar <= '9' || e.KeyChar == '-' || e.KeyChar == ',') {

2020-12-08 10:10:15 1889

原创 C# 实现状态切换 隐藏与显示输入密码

点击buttonShowPassword按钮,转换当前输入内容的展示效果private void buttonShowPassword_Click(object sender, EventArgs e) { showPW = !showPW; if (showPW) { textBoxPassword.PasswordChar = '\0';//输入密码以实际输入结果展示

2020-12-08 09:47:07 3226

原创 面试题解析

1. Unicode缺省是用16位来表示一个字的错。2. java程序的种类有()3. 基本数据类型均可以任意互相转换4.(1) 环境变量可在编译source code时指定(2) 在编译程序时,所能指定的环境变量不包括class path(3) javac一次可以编译数个java源文件(4) javac.exe能指定编译结果要置于哪个目录(direct...

2020-05-12 17:33:13 506

原创 关于电脑的一点小知识

1电脑开机输入完密码后就蓝屏

2020-05-08 09:07:44 187

原创 C# 为节点添加修改图标

bool RangeLinePrintManagerSwitchifON = false;private void ribbonBtnRangeLinePrintManagerSwitch_Click(object sender, EventArgs e){ TreeNode node; if (NodeRight(out node)) { for (...

2019-10-25 16:53:55 304 1

原创 C# 获取list长度

C# 获取List长度List<List<List<double>>> dataList = new List<List<List<double>>>();dataList = this.Context.GetData;int lengthFirst = dataList.GetLength(0);//获取到一维的长...

2019-10-23 15:05:37 31068 5

原创 C# TreeView

TreeView的节点集合使用/// <summary>/// 用来记录正在测试的节点/// </summary>TreeNode node;/// <summary>/// 修改正在测试节点图标/// </summary>/// <param name="nodeColl">树节点集合</param>//...

2019-10-23 14:54:35 265

原创 C# 获取软件版本号

获取软件版本号var serverFileVersion = "";try{ string loadexeName = System.Windows.Forms.Application.ExecutablePath; //loadexeName : "D:\\YokiSystem\\Yoki.UI\\bin\\Debug\\Yoki.UI.exe" FileV...

2019-10-17 11:22:10 1120

原创 C# 在文件资源管理器打开功能

/// <summary>/// 右键在文件资源管理器打开功能/// </summary>public void OpenFolderAndSelectFile(string fileFullName){ System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStar...

2019-10-17 10:20:13 284

原创 C# TreeView节点删除的同时删除对应路径下的本地文件夹/文件

string localFilePath = node.ToolTipText;//localFilePath:节点保存路径FileAttributes attr = File.GetAttributes(localFilePath);//删除文件if (attr == FileAttributes.Directory)//文件夹 Directory.Delete(localFi...

2019-10-17 09:37:19 256

原创 判断字符串内是否含有空格

private bool ExitsBlank(string str){ bool blank = false; int num = str.IndexOf(" "); if (num == -1)//没空格 blank = false; else//有空格 blank = true; return blank;}...

2019-10-16 17:03:22 5017

原创 检测某个本地文件是否已存在

//nodeChange: D:\\myTest\\test8\\demo\\project\\project1//newName: project1if (Directory.Exists(nodeChange)){ treeView1.SelectedNode.EndEdit(true); string mess = "名为“" + newName + "”的文件在该路...

2019-10-14 15:39:17 602

原创 C# TreeView节点重命名

TreeView节点重命名时,发现新节点名与已有节点名重复,终止此次重命名if (nodeInfoList[i].nodeToolTipText == nodeChange){ treeView1.SelectedNode.EndEdit(true); MessageBox.Show("名为“" + newName + "”的项已存在,请为您要添加的项提供一个唯一的名称")...

2019-10-14 15:30:34 1572

原创 将某个路径下的所有文件复制到另一个路径下

private void CopyAll(string srcPath, string destPath) { try { DirectoryInfo dir = new DirectoryInfo(srcPath); FileSystemInfo[] fileinfo...

2019-10-07 16:32:38 446

原创 C# 获取当前路径的上一级(父级目录)

string path = "D:\\test\\test1\\demo";Directory.SetCurrentDirectory(Directory.GetParent(path).FullName);string parentPath = Directory.GetCurrentDirectory();//parentPath = D:\\test\\test1

2019-10-07 11:02:11 10030 4

原创 C#学习

1. system.console.write()和Console.write()有什么区别? 二者没用区别,表达同一个意思。如果在命名空间区域添加了Using System;就可以直接调用Console.write()。2.string s = string.Empty 与 "" 一般情况下,而这可以互换;3. c# backgroundimage 路...

2019-09-25 17:52:26 63

原创 关于checkedListBox

关于checkedListBox控件设置单选相关问题

2019-08-26 12:05:29 149

原创 小问题收集

问题:修改.exe的名称 问题描述:新建项目时,命名空间为Test,生成exe为Test.exe,现在想修改exe名称 解决方法: 右键项目-->属性-->应用程序-->程序集名称 双击项目下的Properties-->应用程序-->程序集名称 问题:设置CheckedListBox选中 解决办法:checkedList...

2019-07-16 10:43:58 59

原创 C#获取程序启动目录

C#获取程序启动目录public string exePath1 = System.Windows.Forms.Application.ExecutablePath;//"E:\\Ami.UI\\bin\\Debug\\Ami.UI.exe"public string StartupPath = Application.StartupPath;//"E:\\Ami.UI\\bin\\Deb...

2019-03-18 11:49:45 1065 2

转载 接口文档

接口文档公共部分样例接口说明

2019-03-11 10:51:15 134

转载 项目开发接口文档

项目开发接口文档

2019-03-11 10:44:13 1521

原创 软件接口说明文档

软件接口说明文档1 引言1.1编写目的说明编写这份详细设计说明书的目的,指出预期的读者。1.2背景说明:a.待开发软件系统的名称;b.本项目的任务提出者、开发者、用户和运行该程序系统的计算中心。1.3定义列出本文件中用到专门术语的定义和外文首字母组词的原词组。1.4参考资料列出有关的参考资料,如:a.本项目的经核准的计划任务书或合同、上级机关的批文;b.属于本项目的其他...

2019-03-11 10:37:36 5549

转载 VS快捷键使用

VS快捷键

2019-02-27 20:56:31 99

原创 C# 字符串、int、double互转

string str = "100"; double num = 10; int count = 5;string temp = string.Empty;//int、double转stringtemp = count.ToString(); temp = num.ToString(); int index;double num2;//string转int、doublen...

2019-02-27 20:53:26 2812

原创 C# 判断字符串为空

if(text.Length == 0){}if(text == ""){}if(text = string.Empty{}三种判断方法

2019-02-27 20:43:18 704

原创 C# 字符串比大小

string latest = string.Empty;int result = -999;for(int i = 0; i &lt; fileInfo.Length - 1; i++){ result = string.Compare(fileinfo[i].ToString(), fileinfo[i + 1].ToString()); if(result &lt;...

2019-02-27 20:34:59 1426

原创 C# 获取当前路径的父路径

//获取当前运行路径的上级目录(父目录)System.IO.DirectoryInfo topDir = System.IO.Directory.GetParent(System.Environment.CurrentDirectory);//D:\项目\测试\test\bin\Debug//继续获取上级的上级的上级的目录。string pathto = topDir.Pa...

2019-02-27 14:03:39 6004

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除