随笔分类 -  c#

摘要:周靖新浪博客 http://transbot.blog.163.comhttp://transbot.ys168.com清华大学图书系列 http://www.tup.tsinghua.edu.cn/book/listtypebook.asp?cid=2&id=76 CLR via c#的本书使用... 阅读全文
posted @ 2015-02-02 16:29 泽刚 阅读(490) 评论(0) 推荐(0)
摘要:判断当前Windows系统是win2000,winXP,winVista,win2003,win7...private static IntPtr GetSysTrayWnd() { IntPtr handle = FindWindow("Shell_TrayWn... 阅读全文
posted @ 2014-06-22 22:05 泽刚 阅读(520) 评论(0) 推荐(0)
摘要:无法使用虚拟目录密码作为用户 Administrator 在本地登录到 C:\inetpub\wwwroot 阅读全文
posted @ 2014-05-14 20:50 泽刚 阅读(997) 评论(0) 推荐(1)
摘要:/// <summary> /// 递归 /// </summary> /// <param name="n"></param> /// <returns></returns> static int factorial(int n) { if (n > 1) { return factorial(n - 1); } else if (n == 1) { ... 阅读全文
posted @ 2013-04-26 15:36 泽刚 阅读(335) 评论(0) 推荐(0)
摘要:新安装了一台windows2008R2,配置php_mysql_Apache环境,系统是64位的,遇到很多麻烦。都下载了64位的压缩包才解决。最后php连接mysql错误,Fatal error: Call to undefined function mysql_connect()百度,google也找了很久,最后也解决了。详细:其他php.in和apache的httpd.conf配置不用说了,关键点1. 把php中的libmysql.dll文件复制到Apache的bin里面,一测试,居然好了。关键点2:配合Apache2时最好使用PHPIniDir,即在apache2/conf/httpd. 阅读全文
posted @ 2013-03-05 10:49 泽刚 阅读(16042) 评论(3) 推荐(1)
摘要:1,服务器系统是server2003 iis6 。 更新完程序,去掉只读属性。打开网站测试,出现问题: 每次连接都弹出window的guest用户登陆框,让输入用户名密码,权限都加了,也没用。最后没法了,直接都用windows的administrator账户登陆。 在iis中设置,默认网站属性--》目录安全性--》身份验证方法--》启用匿名访问, 如图设置 网站正常了。 阅读全文
posted @ 2013-02-26 09:34 泽刚 阅读(4369) 评论(0) 推荐(0)
摘要:症状:使用UpdatePanel和UpdateProgress的时候,经常出现脚本错误,提示“this.get_element .style为空或不是对象”原因:UpdateProgress不能放在UpdatePanel里面解决办法:把UpdateProgress放到UpdatePanel外面 阅读全文
posted @ 2013-01-25 15:09 泽刚 阅读(182) 评论(0) 推荐(0)
摘要:protected void GVMtrPoint_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowIndex >= 0) { e.Row.Attributes.Add("onmouseover", "this.name=this.style.backgroundColor;this.style.backgroundColor='Honeydew';this.style.color='blue'"); e.Row.Attribute 阅读全文
posted @ 2012-11-19 16:27 泽刚 阅读(313) 评论(0) 推荐(0)
摘要:模式窗体,刷新页面 阅读全文
posted @ 2012-11-09 00:15 泽刚 阅读(1312) 评论(0) 推荐(0)
摘要:IQueryable<T>从IEnumerable<T>中派生,包含了LINQ查询表达式信息,通过前向转换为IEnumerable<T>类型的可枚举集合,允许使用foreach语法循环其中的数据。LINQToDataTable<T>泛型方法将使用.NET的反射技术从集合中构取DataTable的架构数据,然后循环将集合中的元素添加到DataTable中。注意:.NET反射定义在System.Reflection命名空间中,该命名空间允许开发人员从现在类型中获取类型元数据信息 。LINQToDataTable<T>泛型方法的实现如代码所 阅读全文
posted @ 2012-09-12 00:13 泽刚 阅读(6285) 评论(0) 推荐(0)
摘要:/// <summary> /// DataTable数据导入到Excel中,这里用Excel标准格式,导出的Excel文件可以再导入到DataTable或者数据库中 /// </summary> /// <param name="dt"></param> /// <param name="strPath"></param> /// <returns></returns> private bool TableIntoExcel(DataTable dt, st 阅读全文
posted @ 2012-09-03 12:03 泽刚 阅读(2766) 评论(0) 推荐(0)
摘要:1.PreInit2.Init3.InitComplete4.PreLoad5.Load6.LoadComplete7.PreRender8.PreRenderComplete 阅读全文
posted @ 2012-09-02 18:43 泽刚 阅读(211) 评论(0) 推荐(0)
摘要:导出Excel程序在本机正常,上传服务器,再测试时,出错很多 。错误:无法将类型为“Microsoft.Office.Interop.Excel.ApplicationClass”的 COM 对象强制转换为接口类型“Microsoft.Office.Interop.Excel._Application”。此操作失败的原因是对 IID 为“{000208D5-0000-0000-C000-000000000046}”的接口的 COM 组件调用 QueryInterface 因以下错误而失败: 不支持此接口 (异常来自 HRESULT:0x80004002 (E_NOINTERFACE))。异常详 阅读全文
posted @ 2012-09-02 16:06 泽刚 阅读(12032) 评论(2) 推荐(1)
摘要:先试用Response.WriteFile的方法:FileInfo fi = new FileInfo(excelFile);//excelFile为文件在服务器上的地址HttpResponse contextResponse = HttpContext.Current.Response;contextResponse.Clear();contextResponse.Buffer = true;contextResponse.Charset = "GB2312"; //设置了类型为中文防止乱码的出现 contextResponse.AppendHeader("Co 阅读全文
posted @ 2012-08-26 16:22 泽刚 阅读(579) 评论(0) 推荐(0)
摘要:外部表不是预期的格式 已解决 阅读全文
posted @ 2012-08-26 16:04 泽刚 阅读(136145) 评论(10) 推荐(14)
摘要:1.手动创建一个控件2.反射查找事件,绑定事件到控件 1 private EventHandler BindEvent(ToolStripMenuItem Toostrip,string EventName) 2 { 3 PropertyInfo propertyInfo = (typeof(ToolStripMenuItem)).GetProperty("Events", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.IgnoreReturn | 阅读全文
posted @ 2012-08-13 00:36 泽刚 阅读(318) 评论(0) 推荐(0)
摘要:/// <summary> /// byte[]流转十六进制字符串 0x34---->"34" /// </summary> /// <param name="bytes"></param> /// <returns></returns> public static string ToHexString(byte[] bytes) { char[] hexDigits = { '0', '1', '2', '3', 阅读全文
posted @ 2012-07-18 21:10 泽刚 阅读(6819) 评论(0) 推荐(0)