随笔分类 -  C#

摘要:public class StepArgs : EventArgs { public int m_IMax = 0; public int m_IStep = 0; public string m_StrInfo = ""; public StepArgs(int max,int step,string info) { m_IMax = max; m_IStep = step; m_StrInfo = info; }... 阅读全文
posted @ 2013-11-22 12:45 kuailewangzi1212 阅读(165) 评论(0) 推荐(0)
摘要:public static string EncodeStr(string str) { str = Regex.Replace(str, @"]*?>.*?", "", RegexOptions.IgnoreCase); str = Regex.Replace(str, @"]*?/>", "", RegexOptions.IgnoreCase); str = Regex.Replace(str, @"]*?>.*?", "", RegexOpti... 阅读全文
posted @ 2013-11-07 09:26 kuailewangzi1212 阅读(2198) 评论(0) 推荐(0)
摘要:StringBuilder sb=new StringBuilder(); string strId=dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells["id"].Value.ToString(); int iCnt = 0;//临时计数器 for (int i = 0; i < this.dataGridView1.Rows.Count; i++) { sb.AppendFormat("u... 阅读全文
posted @ 2013-10-10 10:14 kuailewangzi1212 阅读(2948) 评论(1) 推荐(0)
摘要:使用方法/*DataTable dt= DBUtility.DB.FromSql(sql).ToDataTable(); DataGridViewAddSumRow sumRow = new DataGridViewAddSumRow(); sumRow.Xh_field = "xuhao"; sumRow.DgvName = this.dataGridView1; sumRow.dataTableName =... 阅读全文
posted @ 2013-09-14 14:23 kuailewangzi1212 阅读(5217) 评论(0) 推荐(0)
摘要:using System;using System.Data;using System.Configuration;using System.Web;using System.Data.OleDb;using System.Collections;/// /// AcceHelper 的摘要说明/// public static class AccessHelper{ //数据库连接字符串 //public static readonly string conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Http 阅读全文
posted @ 2013-09-05 22:49 kuailewangzi1212 阅读(1785) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Dynamic;namespace WindowsFormsTest{ public partial class dynamic类 : Form { public dynamic类() ... 阅读全文
posted @ 2013-08-21 23:26 kuailewangzi1212 阅读(1335) 评论(0) 推荐(0)
摘要://动态链接库中PvsApiIfCtrl.Cls.Cls_Public类有一变量 private static string key="abcd";//下面通过反射的技术修改和获取值//设置key public static void updatePalmKey(string key = "1234567890123456") { BindingFlags flag = BindingFlags.Static | BindingFlags.NonPublic; FieldInfo f_key = typeof(PvsApiIfCtrl.... 阅读全文
posted @ 2013-08-21 12:01 kuailewangzi1212 阅读(4364) 评论(2) 推荐(0)
摘要:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSystem.Runtime.InteropServices;usingSystem.Windows.Forms;namespaceYL.Code{publicclassutil{[DllImport("user32.dll",EntryPoint="FindWindow",CharSet=CharSet.Auto)]privateexternstaticIntPtrFindWindow(s 阅读全文
posted @ 2013-08-20 17:59 kuailewangzi1212 阅读(1083) 评论(0) 推荐(0)
摘要:string[] names = { "aa","bb","cc","dd"}; /* IEnumerable query = from s in names where s.Length == 2 orderby s select s.ToUpper(); */ IEnum... 阅读全文
posted @ 2013-08-11 17:01 kuailewangzi1212 阅读(249) 评论(0) 推荐(0)
摘要://.net 1.0写法 /*delegate bool MyMethod(string s); bool myMethod(string s) { return s.IndexOf("abc") >= 0; } MyMethod m1 = new MyMethod(myMethod); List l1 = l.FindAll(m1); */ ... 阅读全文
posted @ 2013-08-11 16:24 kuailewangzi1212 阅读(748) 评论(0) 推荐(0)
摘要:在List中方法FindAll方法,反编译后的代码如下:public List FindAll(Predicate match) { if (match == null) { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.match); } List list = new List(); for (int i = 0; i l = new List();l.Add("abc... 阅读全文
posted @ 2013-08-11 15:25 kuailewangzi1212 阅读(422) 评论(0) 推荐(0)
摘要:System.Text.Encoding.GetEncoding("gb2312").GetBytes(ls_str, 0, ls_str.Length, buffer, 0) 阅读全文
posted @ 2013-06-04 14:48 kuailewangzi1212 阅读(142) 评论(0) 推荐(0)
摘要:System.Globalization.GregorianCalendar gc = new System.Globalization.GregorianCalendar(); int weekOfYear = gc.GetWeekOfYear(DateTime.Parse("2012-01-01"), System.Globalization.CalendarWeekRule.FirstDay, DayOfWeek.Sunday); 阅读全文
posted @ 2012-08-31 16:15 kuailewangzi1212 阅读(1746) 评论(0) 推荐(0)
摘要:sc create shellsysncdata binpath= "E:\dev\SyncData\services\shellsrv.exe" start= "auto" DisplayName= "shellsysncdata "pausesc delete shellsysncdatapause 阅读全文
posted @ 2012-08-29 14:24 kuailewangzi1212 阅读(157) 评论(0) 推荐(0)
摘要:1、配置文件<?xmlversion="1.0"?><configuration><configSections><sectionGroupname="userSettings"type="System.Configuration.UserSettingsGroup,System,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089"><sectionname="ShellSrv.Propertie 阅读全文
posted @ 2012-08-29 09:24 kuailewangzi1212 阅读(3200) 评论(0) 推荐(0)
摘要://程序源代码//模型---------------------------------------------------------------------------------using System;using System.Runtime.CompilerServices;namespace module{ /// <summary> /// 拦截器接口 /// </summary> public interface Intercepter { /// <summary> /// 拦截器最后中调用表示目标对象 methodDelegate.Met 阅读全文
posted @ 2012-03-03 23:01 kuailewangzi1212 阅读(2128) 评论(2) 推荐(1)
摘要:using System;using System.Collections;using System.Collections.Generic;using System.ComponentModel;using System.Configuration.Install;using System.Linq;using System.Diagnostics;using System.Security.AccessControl;using System.IO;namespace testInstall{ [RunInstaller(true)] public partial class myInst 阅读全文
posted @ 2011-11-02 13:19 kuailewangzi1212 阅读(204) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Configuration;using System.IO.Pipes;using System.Threading;namespace WindowsFormsApplication1{ public partial c 阅读全文
posted @ 2011-10-25 09:33 kuailewangzi1212 阅读(291) 评论(0) 推荐(0)
摘要://一、工具类using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;using System.IO.Pipes;namespace ws.NamePipe{ public class Client { string str_ServerName = ""; string str_pipename = ""; /// <summary> /// 构造函数 /// ws.NamePipe.Cl 阅读全文
posted @ 2011-10-25 09:29 kuailewangzi1212 阅读(357) 评论(0) 推荐(0)