C#
文章平均质量分 71
cdz1022
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C#类的继承,构造函数实现及其调用顺序
/*--===------------------------------------------===--- 作者:许明会 日期:类的派生和构造函数间的关系,调用层次及实现 日期:2008年1月18日 17:30:43 希望类有派生类,且有带参构造函数,则必须为其实现默认构造函数,并实现类层次中的所有派生类的默认构造函数。 若类没有实现带参构造,编译器将自动创建默认构造函数(无参构造函转载 2012-07-27 10:29:18 · 735 阅读 · 0 评论 -
C# winform 画面最大化size设定
1.画面最大化时,画面的边框会不显示。然后在计算子画面的位置用主画面的size计算会有一定偏差。 我们可以在画面的构造函数中设定:this.MaximizedBounds =new Rectangle(1, 1, SystemInformation.WorkingArea.Width, SystemInformation.WorkingArea.Height); 2.画面中使用一些插件,可能原创 2013-08-29 10:10:22 · 3153 阅读 · 1 评论 -
C# winform 中控件禁用,但是不变灰
[System.Runtime.InteropServices.DllImport("user32.dll ")] public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int wndproc); [System.Runtime.InteropServices.DllImport("use转载 2013-08-08 16:09:18 · 6840 阅读 · 0 评论 -
C# winform 调用其他语言的Exe文件,并获取返回值
正常来说,那么winform是获取不到EXE的返回值,这时我所用的方法是把EXE中的值写到csv文件中,然后winform去读取csv private void btnGoodsSelect_Click(object sender, EventArgs e) { ParameterizedThreadStart pts = new Param原创 2013-08-02 10:14:42 · 6803 阅读 · 0 评论 -
WinForm自定义的MessageBox介绍
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; using System.Runtime.InteropServices; name转载 2013-07-22 13:17:23 · 2367 阅读 · 0 评论 -
C# 获取键盘输入数字的值
/// /// 重载ProcessCmdKey事件 /// /// /// /// protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { int in原创 2013-07-22 13:13:33 · 10656 阅读 · 0 评论 -
C# 主窗体获取自定义控件中所做check的信息
自定义控件CalenderAD,其中包含三个TextBox txtYear,txtMonth,txtYear; 1.首先在自定义控件中定义两个string型的变量ErrMessage,OprMessage,用来保存信息; 在CalenderAD中的TextBox 做KeyPress时ErrMessage,OprMessage获取相关信息; 2.在主窗体中InitializeComponent原创 2013-07-12 16:15:55 · 1435 阅读 · 0 评论 -
建二叉树code
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System; using System.Collections.Generic; using System.Text; namespace KZ { //二叉树的二叉链表的结点类的实现如下原创 2013-05-30 14:19:39 · 926 阅读 · 0 评论 -
C#中堆排序记录
堆排序的主要原理就是利用堆的特点,首先生成最大堆,然后每次取堆的root和最后一个叶子交换,剔除最后叶子。然后再次生成最大堆,循环。 /// /// 堆排序 /// /// /// private int[] HeapSotr(int[] Myarray) {原创 2013-05-27 10:33:52 · 708 阅读 · 0 评论 -
C# 动态生成的textbox怎样获取值
在页面page_load中: int num = 0; for (int i = 0; i { dgv.Rows.Add(); int n = dgv.Rows.Count - 1;原创 2012-05-19 17:38:28 · 9411 阅读 · 0 评论 -
[C#]DataTable常用操作总结【转】
protected void Page_Load(object sender, EventArgs e) { //①Create a DataTable DataTable dt = new DataTable("Table_AX"); //②Add columns for DataTable //Method转载 2012-07-26 15:01:03 · 409 阅读 · 0 评论 -
HQL
Configuration config=new Configuration().configure; SessionFactory sf=config.buildSessionFactory(); Session session=sf.openSession(); Transaction ts=session.begionTransacton(); Query query=session原创 2012-07-26 15:48:59 · 426 阅读 · 0 评论 -
C#获取项目程序路径的方法
//获取当前进程的完整路径,包含文件名(进程名)。 string str = this.GetType().Assembly.Location; result: X:\xxx\xxx\xxx.exe (.exe文件所在的目录+.exe文件名) //获取新的 Process 组件并将其与当前活动的进程关联的主模块的完整路径,包含文件名(进程名)。 string str = System.转载 2012-07-25 11:35:19 · 532 阅读 · 0 评论 -
iText生产PDF
//Document:(文档)生成pdf必备的一个对象,生成一个Document示例 Document document = new Document(PageSize.A4, 30, 30, 5, 5); //为该Document创建一个Writer实例: PdfWriter.GetInsta原创 2012-07-16 15:19:12 · 519 阅读 · 0 评论 -
NOPI用模板生成excel
private void btnCopy_Click(object sender, EventArgs e) { try { //Excel模板的路径 FileStream file = new FileStream(@"e:/book1.xls", FileMo原创 2012-05-25 09:35:30 · 3448 阅读 · 1 评论 -
C#中关于XML的读取和生成
1.简单的根据Key的值来获取xml的value /// /// 根据key值获取value值 /// /// key值 /// value值 public static string ReadConfig(string configKey)原创 2012-05-25 09:30:21 · 980 阅读 · 0 评论 -
C# CheckedListBox控件的用法 .
1. 添加项 checkedListBox1.Items.Add("蓝色"); checkedListBox1.Items.Add("红色"); checkedListBox1.Items.Add("黄色"); 2. 判断第i项是否选中,选中为true,否则为false if(checkedListBox1.GetItemChecked(i)) {转载 2012-05-19 17:37:41 · 12816 阅读 · 0 评论
分享