骄傲小公主

导航

2014年7月17日 #

WCF之旅

摘要: 转载:创建一个简单的WCF程序http://www.cnblogs.com/artech/archive/2007/02/26/656901.htmlEndpoint Overviewhttp://www.cnblogs.com/artech/archive/2007/02/28/659331.ht... 阅读全文

posted @ 2014-07-17 16:54 骄傲小公主 阅读(100) 评论(0) 推荐(0) 编辑

2014年7月6日 #

C# 执行存储过程

摘要: SqlParameter[] paras = BuildParas(id, time, name); bool bRet = ExcuteProcedure(“数据库连接字符串”, "存储过程名", paras, "表名"); public static SqlParameter[] BuildP... 阅读全文

posted @ 2014-07-06 21:18 骄傲小公主 阅读(199) 评论(0) 推荐(0) 编辑

C# sql操作

摘要: SqlConnection con = new SqlConnection(strSqlConnection);//strSqlConnection为字符串连接 DataTable dtRet = new DataTable(); try { con.Open(); SqlDataAdapter ... 阅读全文

posted @ 2014-07-06 17:27 骄傲小公主 阅读(128) 评论(0) 推荐(0) 编辑

C# 获取配置文件节点值

摘要: string aa=ConfigurationManager.ConnectionStrings[“DataBase”].ConnectionString;//添加system.configuration引用string bb=ConfigurationSettings.AppSetti... 阅读全文

posted @ 2014-07-06 17:21 骄傲小公主 阅读(613) 评论(0) 推荐(0) 编辑

C#创建文件夹、文件

摘要: private void CheckCatcheDirectory()//创建文件夹 { if (!Directory.Exists(xmlFilePath))//xmlFilePath为文件夹路径及名字+\\ { Directory.CreateDirectory(xmlFilePath); } ... 阅读全文

posted @ 2014-07-06 10:49 骄傲小公主 阅读(480) 评论(0) 推荐(0) 编辑

C#写日志

摘要: private static readonly ILog mlog = LogManager.GetLogger(typeof(Message));(命名空间log4net,需要下载log4net.dll)private delegate void WriteMsgHandler(string m... 阅读全文

posted @ 2014-07-06 10:15 骄傲小公主 阅读(123) 评论(0) 推荐(0) 编辑

C#设置程序自启动

摘要: public static void SetAutoRun(string fileName, bool isAutoRun) { RegistryKey reg = null; try { if (!System.IO.File.Exists(fileName)) { LogMessage(mlo... 阅读全文

posted @ 2014-07-06 10:01 骄傲小公主 阅读(185) 评论(0) 推荐(1) 编辑

2014年7月5日 #

winform窗体中查找控件

摘要: private RichTextBox FindControl() { RichTextBox ret = null; try { Control[] controls = Application.OpenForms["MainForm"].Controls.Find("txtContent", ... 阅读全文

posted @ 2014-07-05 19:27 骄傲小公主 阅读(1126) 评论(0) 推荐(0) 编辑

XML操作

摘要: public class XMLOperation { private static readonly ILog log = LogManager.GetLogger(typeof(mainForm)); Message mesg = null; XmlDocument doc; public XM... 阅读全文

posted @ 2014-07-05 12:15 骄傲小公主 阅读(433) 评论(0) 推荐(0) 编辑

C#时间格式

摘要: 可以这样写: date.ToString("yyyy年MM月", DateTimeFormatInfo.InvariantInfo) 日期转化二 DateTime dt = DateTime.Now; Label1.Text = dt.ToString();//2005-11-5 13:21:25 ... 阅读全文

posted @ 2014-07-05 11:53 骄傲小公主 阅读(441) 评论(2) 推荐(2) 编辑