摘要: 1.CheckEdit private void repositoryItemCheckEdit1_QueryCheckStateByValue(object sender, DevExpress.XtraEditors.Controls.QueryCheckStateByValueEventArgs e) { string val = ""; if (e.Value != null) { val = e.Value.ToString(); } ... 阅读全文
posted @ 2013-10-06 16:23 永远的菜鸟@me 阅读(1806) 评论(0) 推荐(0) 编辑
摘要: using DevExpress.XtraTab;using MDI;using System;namespace MyDll{ public partial class MyXtraTabControl : XtraTabControl { public MyXtraTabControl() { InitializeComponent(); } private DevExpress.XtraTab.XtraTabPage CurrentPage = null; private void M... 阅读全文
posted @ 2013-08-14 21:54 永远的菜鸟@me 阅读(601) 评论(0) 推荐(0) 编辑
摘要: 为了测试方便,我们加入新的3列,格式分别是数据,时间,字符串。代码增加下列部分:[csharp]view plaincopy//格式增加dt.Columns.Add("数据",typeof(decimal));dt.Columns.Add("时间",typeof(DateTime));dt.Columns.Add("自定义",typeof(string));dt.Rows.Add(newobject[]{1,"张三",1,"东大街6号","看书","",- 阅读全文
posted @ 2013-08-06 22:56 永远的菜鸟@me 阅读(2204) 评论(0) 推荐(0) 编辑
摘要: 代码来源于网上。首先创建解决方案,类using System;using System.Windows.Forms;using System.Drawing;using MyRichTextBox.Properties;namespace MyRichTextBox{ public class MyRichTextBox : RichTextBox { private System.ComponentModel.IContainer components = null; protected override void Dispose(bool dispo... 阅读全文
posted @ 2013-08-06 16:36 永远的菜鸟@me 阅读(2407) 评论(0) 推荐(0) 编辑
摘要: 以下仅是本人学习用,欢迎大家指正。目的:构建对外接口,验证成功后方能返回数据WebService对外接口不是全部对外公开,用户密码凭以下信息来来验证身份。调用ID 用户名 密码数据库 说明1001 test123321A查询订单数据1002admin 111111C查询对账单先根据ID,用户,密码来验证身份,如果身份通过,则自动匹配数据库A,然后返回相应的数据集,如果没通过,则返回异常代码或空结果。 [WebMethod] public byte[] GET_CUSTOMER_TEST(string companyid, string userid, string use... 阅读全文
posted @ 2013-08-05 11:25 永远的菜鸟@me 阅读(1410) 评论(0) 推荐(0) 编辑
摘要: SqlConnection 在能正常连接的情况下,在连接字符串Connect Timeout=1或CommandTimeout中是有效果的。但是如果主机本身就不正确,上述方法就没有用了,一等就是几十秒吧,CD啊。走过千山万水,找遍万水千山,终于找到了。http://blog.csdn.net/xiaoxian8023/article/details/7248792基本思路就是,能不能在打开连接前先判断,主机是否能正常连接。方法如下: public static bool TcpTestConnection(string host, int port, int millisecondsTime. 阅读全文
posted @ 2013-08-03 19:00 永远的菜鸟@me 阅读(1428) 评论(0) 推荐(0) 编辑
摘要: using System.Windows.Forms;using System.Drawing;namespace 控件拖动{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private enum EnumMousePointPosition { MouseSizeNone = 0, //'无 MouseSizeRight = 1, //... 阅读全文
posted @ 2013-08-02 11:24 永远的菜鸟@me 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 在WinForm里面有时候需要清空自己输入内容或是选择的选项,以便重新操作流程,那么一般你是怎么清空界面各个控件值的呢?如果窗体里面控件,尤其是TextBox控件比较多的时候,代码里面是不是要设置每个控件的Text属性值为空呢?下面我用这个例子,来探讨下清空界面控件值的小技巧。而且还能复用。不必每个窗体都做这些枯燥、无聊的工作。 一般的做法是在清除控件的事件里面添加下面这样的代码: private void btnClear_Click(object sender, EventArgs e) { this.txbAccount.Text = ""; ... 阅读全文
posted @ 2013-08-02 11:04 永远的菜鸟@me 阅读(3456) 评论(0) 推荐(0) 编辑
摘要: using System.Web.Services;using System.Data;using Microsoft.Practices.EnterpriseLibrary.Data;using System.IO;using System.IO.Compression;using System.Runtime.Serialization.Formatters.Binary;namespace WebService1{ /// /// Service1 的摘要说明 /// [WebService(Namespace = "http://tempuri.org/")... 阅读全文
posted @ 2013-08-02 10:46 永远的菜鸟@me 阅读(268) 评论(0) 推荐(0) 编辑
摘要: public static void GetPulicAddress(ref string pubip, ref string address) { try { string strUrl = "http://iframe.ip138.com/ic.asp";//获得IP的网址 Uri uri = new Uri(strUrl); WebRequest webreq = WebRequest.Create(uri); ... 阅读全文
posted @ 2013-07-31 23:09 永远的菜鸟@me 阅读(1117) 评论(0) 推荐(0) 编辑