麦田

不积跬步无以至千里.

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
上一页 1 ··· 10 11 12 13 14

2012年12月14日

摘要: //列中的按钮点击事件 private void dataGridViewTemplate_CellContentClick(object sender, DataGridViewCellEventArgs e) { //MessageBox.Show(this.dataGridViewTemplate.CurrentRow.Cells[2].Value.ToString()); } 阅读全文
posted @ 2012-12-14 09:16 一些记录 阅读(1109) 评论(0) 推荐(0)

2012年12月13日

摘要: 方法一:private void tBox_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 0x20) e.KeyChar = (char)0; //禁止空格键 if ((e.KeyChar == 0x2D) && (((TextBox)sender).Text.Length == 0)) return; //处理负数 if (e.KeyChar > 0x20) { try ... 阅读全文
posted @ 2012-12-13 14:11 一些记录 阅读(1015) 评论(0) 推荐(0)

摘要: 第一步:在窗体2中定义委托定义事件public delegate void Change(string newSendEmails);//定义委托 改委托要和UI中的现实方法一样 public event Change myChangeevent;//定义事件在某个方法或者事件里面执行事件myChangeevent(sb.ToString());//执行事件第二步:在窗体1中定义一个和窗体2委托对应形参和返回值的方法(事件执行方法) //事件执行方法 public void SetSendEmail(string newEmails) {... 阅读全文
posted @ 2012-12-13 14:04 一些记录 阅读(1638) 评论(0) 推荐(0)

摘要: 一般认为:foreach (object obj in checkedListBox1.SelectedItems)即可遍历选中的值。其实这里遍历的只是高亮的值并不是打勾的值。遍历打勾的值要用下面的代码:for (int i = 0; i < checkedListBox1.Items.Count; i++){ if (checkedListBox1.GetItemChecked(i)) { MessageBox.Show(checkedListBox1.GetItemText(checkedListBox1.Items[i])); }}最近用到checklis... 阅读全文
posted @ 2012-12-13 13:44 一些记录 阅读(24067) 评论(1) 推荐(0)

摘要: ///转移全部 private void buttonSendAll2Nosend_Click(object sender, EventArgs e) { for (int i = 0; i < this.checkedListBoxSend.Items.Count; i++) { this.checkedListBoxSiftEmail.Items.AddRange(this.checkedListBoxSend.Items); this.checkedLis... 阅读全文
posted @ 2012-12-13 13:39 一些记录 阅读(591) 评论(0) 推荐(0)

摘要: CheckBoxList clbox = new CheckBoxList();clbox.Items.Add(new ListItem("text", "value"));//选中新增加的项clbox.Items[clbox.Items.Count-1].Selected = true; 阅读全文
posted @ 2012-12-13 13:03 一些记录 阅读(1153) 评论(0) 推荐(0)

摘要: 初学winform的时候,一直以为winform中的combox只能添加简单的仅有text的item,而不象aspx中的listitem那样即有text,又有value,结果很快发现自己错了,以下是一个示例:先声明一个类 public class ClsItemObject { public string ClassName = "", ClassId = ""; public ClsItemObject(string _clsName, string _clsId) { ClassName = _clsName; ClassId = _clsId; } 阅读全文
posted @ 2012-12-13 12:49 一些记录 阅读(233) 评论(0) 推荐(0)

摘要: 让datagridview默认选中一行,系统默认的是选中第一行的第一个单元格datagridview 有个属性叫“SelectlionMode”,将其改成 FullRowSelect 就行了 阅读全文
posted @ 2012-12-13 11:17 一些记录 阅读(3650) 评论(0) 推荐(0)

摘要: dataGridView有一个属性,SelectedRows,就是你所选中的行的集合.你可以用for循环或者foreach循环遍历这个集合取其第一列的值.string rowFirstCell;for(int i=0;i<objdgv.SelectedRows.count;i++){ rowFirstCell=objdgv.SelectedRows[i].Cells[0].Value.ToString(); 在这里把rowFirstCell做为参数调用你的其他方法.} 阅读全文
posted @ 2012-12-13 09:32 一些记录 阅读(3100) 评论(0) 推荐(1)

摘要: private void dataGridViewQQGloup_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { dataGridViewQQGloup.Rows[dataGridViewQQGloup.CurrentCell.RowIndex].Selected = true; } private void dataGridViewQQGloup_CellMouseDown(object sender, DataGridViewC... 阅读全文
posted @ 2012-12-13 09:30 一些记录 阅读(2797) 评论(0) 推荐(0)

2012年12月12日

摘要: for (int i = 0; i < lines.Length; i++) { QQEntity qqEntity = new QQEntity(); qqEntity.Name = lines[i].Split(',')[0]; qqEntity.Id = i; qqEntity.Password = lines[i].Split(',')[1]; qqList.Add(qqEntity); ... 阅读全文
posted @ 2012-12-12 17:48 一些记录 阅读(261) 评论(0) 推荐(0)

摘要: datagridview 去掉行头的空白 RowHeadersVisibleautosizeversion fill 阅读全文
posted @ 2012-12-12 17:38 一些记录 阅读(382) 评论(0) 推荐(0)

摘要: //绑定该邮箱到datagridview int index = this.dataGridViewSendEmail.Rows.Add(); DataGridViewRow row = this.dataGridViewSendEmail.Rows[index]; row.Cells[1].Value = emailAddr; row.Cells[2].Value = "正常"; row.Cells[3].Value = DateTime.No... 阅读全文
posted @ 2012-12-12 17:19 一些记录 阅读(183) 评论(0) 推荐(0)

摘要: OpenFileDialog fileDialog = new OpenFileDialog(); fileDialog.Multiselect = true; fileDialog.Title = "请选择文件"; fileDialog.Filter="所有文件(*.*)|*.*"; if (fileDialog.ShowDialog() == DialogResult.OK) { string file=fileDialog.FileName; ... 阅读全文
posted @ 2012-12-12 17:14 一些记录 阅读(202) 评论(0) 推荐(0)

摘要: 实例化发送配置信息emailConfigEntity.SendNumEveryTime = Convert.ToInt32(this.textBoxSendNumEveryTime.Text.Trim() == "" ? "0" : this.textBoxSendNumEveryTime.Text.Trim());emailConfigEntity.SendTimes = Convert.ToInt32(this.textBoxSendTimes.Text.Trim() == "" ? "0" : this.te 阅读全文
posted @ 2012-12-12 10:56 一些记录 阅读(226) 评论(0) 推荐(0)

摘要: EmailReceivesEntity emailReceivesEntity = null; foreach (string item in receiveEmails) { emailReceivesEntity.EmailAddr = item; 阅读全文
posted @ 2012-12-12 10:52 一些记录 阅读(180) 评论(0) 推荐(0)

摘要: //身份验证 if (!sfrom.ToLower().Contains("hotmail") && !sfrom.ToLower().Contains("hexun")) { client.Credentials = new NetworkCredential(sSMTPuser, sSMTPpass); } client.DeliveryMethod = SmtpDeliveryMethod.Netwo... 阅读全文
posted @ 2012-12-12 10:03 一些记录 阅读(806) 评论(1) 推荐(0)

摘要: string[] receiveEmails = receiverEmail.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); 阅读全文
posted @ 2012-12-12 09:40 一些记录 阅读(599) 评论(0) 推荐(0)

2012年12月11日

摘要: /// <summary>/// 类说明:Assistant/// 编 码 人:苏飞/// 联系方式:361983679 /// 更新网站:http://www.cckan.net/thread-655-1-1.html/// </summary>using System;using System.IO;using System.Diagnostics;using Microsoft.Win32;using ICSharpCode.SharpZipLib.Checksums;using ICSharpCode.SharpZipLib.Zip;///压缩、解压缩类name 阅读全文
posted @ 2012-12-11 23:02 一些记录 阅读(209) 评论(0) 推荐(0)

摘要: /// <summary> /// 获取邮件通过lumisoft /// </summary> /// <param name="pop3Server">邮件服务器</param> /// <param name="username">用户名</param> /// <param name="password">密码</param> /// <returns>邮件链表</returns> public List< 阅读全文
posted @ 2012-12-11 18:21 一些记录 阅读(1384) 评论(0) 推荐(0)

摘要: /// <summary> /// 调用lumisoft发送邮件 /// </summary> /// <param name="fromEmailAddr">发送者的邮件地址</param> /// <param name="toEmailAddr">给谁发的邮件地址</param> /// <param name="subjectText">主题</param> /// <param name="bodyText&quo 阅读全文
posted @ 2012-12-11 18:19 一些记录 阅读(466) 评论(0) 推荐(0)

摘要: /// C#发送邮件函数 该方法调用的是微软的.NET内部组件 /// </summary> /// <param name="from">发送者邮箱</param> /// <param name="fromer">发送人</param> /// <param name="to">接受者邮箱</param> /// <param name="toer">收件人</param> /// <param n 阅读全文
posted @ 2012-12-11 18:16 一些记录 阅读(323) 评论(0) 推荐(0)

2012年12月8日

摘要: C#中遍历checkBox的几种简单方法2010-07-07 13:35:44|分类:C#|字号订阅//遍历CheckBox方法1 foreach(ControlcingroupBox1.Controls)//遍历groupBox1内的所有控件 { if(cisCheckBox)//只遍历CheckBox控件 { ((CheckBox)c).Checked=(pdwPortVal&(1<<(checkBox8.TabIndex-c.TabIndex)))!=0; } } //遍历CheckBox方法2 /* for(inti=8;i>=1;i--) { ((Check 阅读全文
posted @ 2012-12-08 16:22 一些记录 阅读(2857) 评论(0) 推荐(0)

2012年11月30日

摘要: try{WebClient MyWebClient = new WebClient();MyWebClient.Credentials = CredentialCache.DefaultCredentials;//获取或设置用于对向Internet资源的请求进行身份验证的网络凭据。Byte[] pageData = MyWebClient.DownloadData("http://www.baidu.com");//从指定网站下载数据string pageHtml = Encoding.Default.GetString(pageData); //如果获取网站页面采用的是G 阅读全文
posted @ 2012-11-30 21:45 一些记录 阅读(163) 评论(0) 推荐(0)

2012年11月27日

摘要: /// <summary> /// 验证邮件格式 /// </summary> /// <param name="email">邮件地址</param> /// <returns>是否匹配</returns> public bool Checkemail(String email) { String strExp = @"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"; Regex r = new R... 阅读全文
posted @ 2012-11-27 16:14 一些记录 阅读(621) 评论(0) 推荐(0)

摘要: --每页3条 第一页select * from (select *,row_number() over(order by pid desc) as num from Photos) as twhere num between 1 and 3 order by pid desc --每页3条 第二页select * from (select *,row_number() over(order by pid desc) as num from Photos) as twhere num between 4 and 6 order by pid desc --每页3条 第三页select * fr. 阅读全文
posted @ 2012-11-27 16:01 一些记录 阅读(232) 评论(0) 推荐(0)

摘要: SqlConnection con = new SqlConnection("连接字符串");SqlCommand cmd = new SqlCommand("SelectManStudent", con);SqlParameter parm = new SqlParameter("@Sex", SqlDbType.NVarChar);parm.Value = '男';//此处传性别cmd.Parameters.Add(parm);cmd.CommandType = CommandType.StoredProcedur 阅读全文
posted @ 2012-11-27 15:58 一些记录 阅读(191) 评论(0) 推荐(0)

2012年11月25日

摘要: 一、下载1、PowerDesigner 12.5官方下载地址http://download.sybase.com/eval/PowerDesigner/powerdesigner125_eval.exe 大小125 MB (132,006,349字节)2、汉化用文 件,直接覆盖到安装目录pdshell12.part01.rar(850 K) 下载次数:140pdshell12.part02.rar(850 K) 下载次数:89pdshell12.part03.rar(850 K) 下载次数:69pdshell12.part04.rar(850 K) 下载次数:65pdshell12.part0 阅读全文
posted @ 2012-11-25 15:43 一些记录 阅读(656) 评论(0) 推荐(0)

摘要: C#多线程函数如何传参数和返回值提起多线程,不得不提起委托(delegates)这个概念.我理解的委托就是具有同样参数和返回值的函数的集合.比如public delegate void MyDelegate(int arg);就是这种形式的函数 void Myfuntion(int i); 的集合.如何将一个函数加入 委托 的集合?MyDelegate dele = new MyDelegate(Myfuntion1);再增加一个dele += new MyDelegate(Myfuntion2); ...委托函数dele就是具有整数参数和空返回值的函数Myfuntion1,2的集合.调用这. 阅读全文
posted @ 2012-11-25 15:36 一些记录 阅读(7715) 评论(0) 推荐(0)

摘要: 假如要在一个线程中异步执行一个方法,则先创建一个该方法的委托类型,然后CLR会自动为该委托类型定义一个BeginInvoke方法和EndInvoke方法,我们就靠这两个方法异步调用委托类型指向的方法(这句话有点绕口,呵呵)BeginInvoke这个方法用于启动异步调用,该方法具有和要异步执行的方法具有相同的参数列表,只不过又多加了两个参数,多加的那两个参数的作用在后面介绍。执行BeginInvoke方法后,将立即返回一个IAsyncResult,用于监视被调用方法执行的进度。EndInvoke这个方法用于得到异步调用的结果,调用BeginInvoke方法后随时可以调用EndInvoke方法,假 阅读全文
posted @ 2012-11-25 15:33 一些记录 阅读(5983) 评论(0) 推荐(0)

摘要: C# Timer用法有哪些呢?我们在使用C# Timer时都会有自己的一些总结,那么这里向你介绍3种方法,希望对你了解和学习C# Timer使用的方法有所帮助。关于C# Timer类 在C#里关于定时器类就有3个C# Timer使用的方法1.定义在System.Windows.Forms里C# Timer使用的方法2.定义在System.Threading.Timer类里 "C# Timer使用的方法3.定义在System.Timers.Timer类里下面我们来具体看看这3种C# Timer用法的解释:◆System.Windows.Forms.Timer应用于WinForm中的,它 阅读全文
posted @ 2012-11-25 15:30 一些记录 阅读(667) 评论(0) 推荐(0)

2012年9月17日

摘要: 封装:隐藏代码实现 复用 修改方便继承:多态:面试是好解析面向对象最好立即拿周围的事务来说比如桌子先分析类:桌子和椅子他们都是家具所以定义一个家具类 它是怎么材料 这个就是属性它能做什么 这个就是方法 比如能坐 能放东西在上面然后定义一个椅子类 它应该是家具 所以继承自家具类它也有一个属性 它还有另外的属性 比如高度 等我们把椅子封装到一个类里面 然后通过这个类 我们就可以制作很多对象比如椅子1号 椅子2号 然后我们再定义一个person类它只要调用椅子的方法 就可以使用它的方法 我们无需知道椅子内内部是如何实现的因为所有椅子都有一个------------------------------ 阅读全文
posted @ 2012-09-17 22:26 一些记录 阅读(683) 评论(0) 推荐(0)

摘要: -----------------------------------数据库中写存储过程CREATE PROC usp_pageSplit2@pageIndex int,@pageSize int,@pageCount int OUTPUT,@records int outputASbeginSELECT @pageCount = COUNT(*) FROM dbo.SSET @records = CEILING(@pageCount/@pageSize)SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY SNO DESC) AS num , * 阅读全文
posted @ 2012-09-17 22:14 一些记录 阅读(329) 评论(0) 推荐(0)

上一页 1 ··· 10 11 12 13 14