摘要: 通过Button打开一个对话框,选择一个文件,在TextBox中显示文件的绝对路径private void btnOpen_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); if (ofd.ShowDialog() == DialogResult.OK) { txtPath.Text = ofd.FileName; } }窗体中通过代码添加按钮的背景颜色pu... 阅读全文
posted @ 2013-02-19 18:14 乡香田甜 阅读(1941) 评论(0) 推荐(0) 编辑
摘要: 隐式转换,和显示转换 Checked (可能溢出时加上这个关键词)与uncheckedusing System;using System.Windows.Forms;class Conversions{ static void Main() { int a=5; long b; b=a;//隐式转换 Console.WriteLine(b); long c=5; int d; d=(int)c;//显示转换 Console.WriteLine(d); Co... 阅读全文
posted @ 2013-02-19 17:15 乡香田甜 阅读(440) 评论(0) 推荐(0) 编辑
摘要: 集合:成功解决方案储备 阅读全文
posted @ 2013-02-19 14:21 乡香田甜 阅读(171) 评论(0) 推荐(0) 编辑
摘要: C# 系统配制技巧全集 阅读全文
posted @ 2013-02-19 14:17 乡香田甜 阅读(401) 评论(0) 推荐(0) 编辑
摘要: 应用: TimeSpan ts =Convert.ToDateTime(serModel.EndDate).Subtract(Convert.ToDateTime(serModel.SatrtDate));serModel.ExecuteTrimLenght = Convert.ToInt32(ts.TotalSeconds);源码:1)(dt1 - dt2).TotalSecondsor dt1.Subtract(dt2).TotalSeconds2)要是想在C#中,就这么做, datatime d1=new datatime(2007,8,12,2,36,35); datatime... 阅读全文
posted @ 2013-02-19 11:27 乡香田甜 阅读(197) 评论(0) 推荐(0) 编辑
摘要: C#验证:限制TextBox只能输入数字并控制输入数字的长度 阅读全文
posted @ 2013-02-19 11:06 乡香田甜 阅读(2424) 评论(0) 推荐(0) 编辑
摘要: TcpClient和TcpListener 类的使用-编写一个点对点聊天工具(初级入门篇) 阅读全文
posted @ 2013-02-19 09:58 乡香田甜 阅读(683) 评论(0) 推荐(0) 编辑
摘要: 窗体不可移动 C# WinForm 阅读全文
posted @ 2013-02-18 10:12 乡香田甜 阅读(539) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// Double转换 /// </summary> /// <param name="obj"></param> /// <returns></returns> public static double ToDouble(this object obj) { if (obj == null || obj == DBNull.Value || string.IsNullOrEmpty(obj.ToString())) ... 阅读全文
posted @ 2013-01-26 11:57 乡香田甜 阅读(443) 评论(0) 推荐(0) 编辑
摘要: DevExpress.XtraGrid.Views.BandedGrid 阅读全文
posted @ 2013-01-19 11:43 乡香田甜 阅读(2695) 评论(0) 推荐(0) 编辑
摘要: ClickOnce部署发布 应用程序 阅读全文
posted @ 2013-01-08 14:14 乡香田甜 阅读(417) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 用例消息处理 /// </summary> public void TaskCaseAsk(TestActionRequestMessage request) { try { taskCaseList.Clear(); IList<TestCase> lstcase = ScriptCacheManager.GetTestCaseFromSvn(request.SvnProjectInfo); ... 阅读全文
posted @ 2013-01-08 10:28 乡香田甜 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 打开另一程序 程序重启 Process类 c#如何用一个程序打开另一个程序(如:窗体的注销重启) 阅读全文
posted @ 2012-12-28 10:45 乡香田甜 阅读(1202) 评论(0) 推荐(0) 编辑
摘要: IIS 网站发布 阅读全文
posted @ 2012-12-25 20:08 乡香田甜 阅读(739) 评论(0) 推荐(0) 编辑
摘要: 实现步骤:1.定义事件2.定义方法3.完善步骤2中的方法 1)在步骤2中的参数方法,定义参数方法,主要获取界面查询条件 2)实现在步骤2中的数据SQL查询语句方法实例操作如下:1.定义事件btnSelectUserList.Click += btnSelectUserList_Click;2.定义方法void btnSelectUserList_Click(object sender, EventArgs e) { SelectUserList(); }3.完善步骤2中的方法 private void SelectUserList() { ... 阅读全文
posted @ 2012-12-19 22:56 乡香田甜 阅读(1613) 评论(0) 推荐(0) 编辑
摘要: XtraEditors.RadioGroup 获取控件选择的值 阅读全文
posted @ 2012-12-19 11:54 乡香田甜 阅读(2522) 评论(1) 推荐(0) 编辑
摘要: 正则表达式 验证 界面验证 阅读全文
posted @ 2012-12-17 10:17 乡香田甜 阅读(735) 评论(1) 推荐(0) 编辑
摘要: if (BaseClass.UserCache.ContainsKey(userInfo.CreatedBy ?? -1)) { txtCreateBy.Text = BaseClass.UserCache[userInfo.CreatedBy ?? -1]; } else txtCreateBy.Text = "error";PublicBase.cs类 /// <summary> /// 用户名缓存:key=UserId value=DisPlayName /// </summary> public static Dictionary<in 阅读全文
posted @ 2012-12-15 18:55 乡香田甜 阅读(417) 评论(0) 推荐(0) 编辑