随笔分类 -  C#

摘要:win8.1后,Windows支持程序图标的定制显示。 一般我们制作win程序时,会给程序设定一个标准的icon,不过这个图标不能满足win10的图标显示需求了,现在我们就用qq为例,定制一下程序图标。 我们先看一下默认的qq图标在开始菜单中的显示 这个图标的样式,是通过开始项里的lnk找到程序获取 阅读全文

posted @ 2019-12-26 16:31 云起 阅读(15) 评论(0) 推荐(0) 编辑 |

摘要:问题来源于leetcode.42。 问题描述: 给定 n 个非负整数表示每个宽度为 1 的柱子的高度图,计算按此排列的柱子,下雨之后能接多少雨水。 上面是由数组 [0,1,0,2,1,0,1,3,2,1,2,1] 表示的高度图,在这种情况下,可以接 6 个单位的雨水(蓝色部分表示雨水)。 解题过程: 阅读全文

posted @ 2019-01-07 16:54 云起 阅读(5) 评论(0) 推荐(0) 编辑 |

摘要:void ConvexHull(Point[] pts) { int[][] temp = new int[pts.Length][]; for (int i = 0; i < pts.Length; i++) { temp[i] = new int[2]; temp[i][0] = (int)(p 阅读全文

posted @ 2018-01-08 14:34 云起 阅读(8) 评论(0) 推荐(0) 编辑 |

摘要://获取部件所在位置。 //如果其所在的dll在GAC中,那返回的就是gac中的路径。 str=this.GetType().Assembly.Location; //获取新的Process组件并将其与当前活动的进程关联的主模块的完整路径,包含文件名(进程名)。 str=System.Diagnos 阅读全文

posted @ 2017-12-08 10:52 云起 阅读(3) 评论(0) 推荐(0) 编辑 |

摘要:一、用 MSScriptControl 在 C# 中执行 JavaScript 代码 javascript 中有个eval方法,用过的人都知道他的方便和强大之处。 在C#中,我们也可以通过Com组件来执行一段javascript代码。 下面的代码展示了如何用MSScriptControl 组件执行一 阅读全文

posted @ 2017-05-22 17:03 云起 阅读(34) 评论(0) 推荐(0) 编辑 |

摘要:/// <summary> /// 字符串相似度算法-编辑距离法 /// </summary> /// <param name="str1"></param> /// <param name="str2"></param> /// <returns>返回的值越大相似度越高</returns> pub 阅读全文

posted @ 2016-01-14 13:10 云起 阅读(2) 评论(0) 推荐(0) 编辑 |

摘要:/// <summary> /// Http下载文件 /// </summary> public static string HttpDownloadFile(string url, string path) { // 设置参数 HttpWebRequest request = WebRequest 阅读全文

posted @ 2015-11-25 17:15 云起 阅读(6) 评论(0) 推荐(0) 编辑 |

摘要:public class WordUtility { private _Application wordApp = null; private _Document wordDoc = null; public _Application Application { get { return wordA 阅读全文

posted @ 2015-11-17 09:15 云起 阅读(4) 评论(0) 推荐(0) 编辑 |

摘要:public class ExcelOper { private Application _excelApp = null; public ExcelOper() { } #region 读取Excel的内容 /// <summary> /// 获取Excel的内容 /// 备注:把Excel读取到 阅读全文

posted @ 2015-09-24 12:26 云起 阅读(4) 评论(0) 推荐(0) 编辑 |

摘要:1、Encountered multiple versions of the assembly with GUID Try pre-importing one of these assemblies 异常 vs2008 开发的 winform程序 迁移到 vs2010后编译发生错误。 “Encoun 阅读全文

posted @ 2015-09-22 13:03 云起 阅读(4) 评论(0) 推荐(0) 编辑 |

摘要:c#对内存的操作~~ 最近一直不务正,老打算用C#写个外挂出来。 这方面对C#来说是个弱项,但并不表示无法做到。 下面写个简单的例子,和大家交流一下。 以windows中的扫雷为例,比如说读取雷的数量。 1.首先导入API(对底层的操作都要用API): [DllImport("kernel32.dl 阅读全文

posted @ 2015-09-19 09:08 云起 阅读(12) 评论(0) 推荐(0) 编辑 |

摘要:this.button1.Click += new System.EventHandler(delegate(object sender, System.EventArgs e) { this.Close(); }); void button1_Click(object sender, EventA 阅读全文

posted @ 2015-09-09 16:18 云起 阅读(3) 评论(0) 推荐(0) 编辑 |

摘要:using System; using System.Collections.Generic; using System.Text; using System.Net; using System.IO; using System.Windows.Forms; namespace ConvertDat 阅读全文

posted @ 2015-07-29 16:02 云起 阅读(4) 评论(0) 推荐(0) 编辑 |

摘要:DirectoryInfo GetPrant(DirectoryInfo path, int level) { DirectoryInfo temp = null; if (level > 1) { level--; temp = GetPrant(path.Parent, level); } el 阅读全文

posted @ 2015-06-08 14:35 云起 阅读(2) 评论(0) 推荐(0) 编辑 |

摘要:c#正则表达式用法大全 只能输入数字: "^[0-9]*"n"\dn" 。 只能输入至少n位的数字: "^\d{n,}"m n"\dm,n" 只能输入零和非零开头的数字: "^(0|[1-9][0-9]*)$" 。 只能输入有 阅读全文

posted @ 2015-05-19 17:58 云起 阅读(5) 评论(0) 推荐(0) 编辑 |

摘要:regsvr32.exe使用详解: regsvr32.exe是32位系统下使用的DLL注册和反注册工具,使用它必须通过命令行的方式使用,格式是: regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DLL文件名 命令可以在“开始→运行”的文本框中,也可以事先在bat批处理文 阅读全文

posted @ 2015-05-19 09:52 云起 阅读(15) 评论(0) 推荐(0) 编辑 |

摘要:DirectoryInfo theFolder = new DirectoryInfo(@"H:\图片\"); DirectoryInfo[] dirInfo = theFolder.GetDirectories(); //遍历文件夹 foreach (DirectoryInfo NextFolde 阅读全文

posted @ 2015-05-13 17:34 云起 阅读(3) 评论(0) 推荐(0) 编辑 |

摘要:计算机常用的彩色空间为RGB,分为红绿蓝三色,通过调配三个分量的比例来组成各种颜色。一般可采用1、2、4、8、16、24、32位来存储。不过现在一个分量最大用8位表示,最大值为255,对32位颜色,高8位是用来表示通透度。彩色图一般指16位以上的图。灰度图的特殊之处在于三个分量相等,而一般灰度图是8 阅读全文

posted @ 2015-05-13 17:28 云起 阅读(12) 评论(0) 推荐(0) 编辑 |

摘要:想用sql做简单的分页查询,但是用rownum的时候,会出现问题。 select * from ( select t.*,rownum from ( select * from tablename where condition order by columnname) t ) where rown 阅读全文

posted @ 2015-03-24 17:23 云起 阅读(3) 评论(0) 推荐(0) 编辑 |

摘要:小功能,备忘 MailMessage objMailMessage = new MailMessage();//引入System.Net objMailMessage.From = new MailAddress("**@sina.com");//源邮件地址 (发件人地址) objMailMessa 阅读全文

posted @ 2015-02-06 13:41 云起 阅读(4) 评论(0) 推荐(0) 编辑 |

随笔 - 119, 文章 - 0, 评论 - 3, 阅读 - 4066

Copyright © 2025 云起
Powered by .NET 9.0 on Kubernetes

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