上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 31 下一页
摘要: 在Form_Load中输入如下代码: foreach(Control ctrl in this.Controls) { if ((ctrl is TextBox) || (ctrl is ComboBox)) //如果文本框或下拉框放在组合框中,你应该用如groupBox1.TextBox { ctrl.KeyDown += new System.Windows.F... 阅读全文
posted @ 2007-02-28 14:16 冷火 阅读(1831) 评论(1) 推荐(0)
摘要: 添加引用 using System.Reflection;using System.Runtime.InteropServices;using System.Diagnostics; 调用DLL文件 [DllImport("User32.dll")]private static extern bool ShowWindowAsync(IntPtr hWnd, int cmdShow);[DllIm... 阅读全文
posted @ 2007-02-28 14:15 冷火 阅读(459) 评论(0) 推荐(0)
摘要: 添加引用 using System;using System.Text;using System.Security.Cryptography;using System.IO; //默认密钥向量private static byte[] Keys = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };/// /// DES加密字符串/// //... 阅读全文
posted @ 2007-02-28 14:09 冷火 阅读(3229) 评论(8) 推荐(1)
摘要: WinForm: public string GetMD5(string str){ byte[] b = System.Text.Encoding.Default.GetBytes(str); b = new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(b); StringBuilder... 阅读全文
posted @ 2007-02-28 14:08 冷火 阅读(300) 评论(0) 推荐(0)
摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Data.SqlClient;using System.Drawing;using System.Text;using System.Windows.Forms;using System.C... 阅读全文
posted @ 2007-02-13 10:50 冷火 阅读(2457) 评论(0) 推荐(0)
摘要: --> Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->public class Chain { //Chain proporty public string ID; public stri... 阅读全文
posted @ 2007-02-08 11:07 冷火 阅读(524) 评论(0) 推荐(0)
摘要: 启动子进程,不等待子进程结束 private void simpleRun_Click(object sender, System.EventArgs e){ System.Diagnostics.Process.Start(@"C:\listfiles.bat");} 2.启动子进程,等待子进程结束,并获得输出 1private void runSyncAndGetResults_Click(... 阅读全文
posted @ 2007-02-07 15:37 冷火 阅读(1548) 评论(0) 推荐(0)
摘要: 利用TableAdapter Configuration Wizard创建数据访问层 在Visual Studio 2005 中,新增了TableAdapter configuration wizard来很方便地创建数据访问层。首先,我们了解下什么是tableadapter。一个tableadapter连接到数据库,执行查询语句或者存储过程,并且将返回的结果集填充到datatable中去。Tab... 阅读全文
posted @ 2007-02-07 15:37 冷火 阅读(607) 评论(1) 推荐(0)
摘要: TreeView 是一个很好的表达树形结构的控件。如果要加载的数据比较多的话,就需要逐层加载数据。要实现逐层加载数据,首先想到的就是TreeView 的 BeforeExpand 事件,它在节点展开前触发。但问题是BeforeExpand 事件每次展开时都会触发。有没有只在首次展开才触发的事件呢,可惜没找到。没关系,我们自定义一个 TreeView 节点类,给它加一个是否首次被展开的属性。 ... 阅读全文
posted @ 2007-02-07 14:31 冷火 阅读(696) 评论(0) 推荐(0)
摘要: //查询后,翻页问题的解决办法2。(GridView1.PageIndex = e.NewPageIndex;) 1.前面的翻页解决办法,只是实现目的的变通办法,适合简单的查询页面。下面的则是正面的解决办法。 2.在GridView的事件中,双击PageIndexChanging事件,在.cs文件中写GridView1_PageIndexChanging函数。 3.在该函数中,把查询的语句完全复制... 阅读全文
posted @ 2007-02-06 14:41 冷火 阅读(396) 评论(0) 推荐(0)
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 31 下一页