摘要: 1、水晶报表的运行时,需要从12版升级到13版。下载地址:http://www.businessobjects.com/jump/xi/crvs2010/us2_default.asp2、Web.Config文件中,需要添加:<startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /> </startup>(这个原因还没弄 阅读全文
posted @ 2012-05-18 08:08 David.Yang 阅读(991) 评论(0) 推荐(0) 编辑
摘要: 题目如下:程序设计: 猫大叫一声,所有的老鼠都开始逃跑,主人被惊醒。(C#语言)要求:1.要有联动性,老鼠和主人的行为是被动的。2.考虑可扩展性,猫的叫声可能引起其他联动效应。实现方法一:View Code 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace CatSound2 7 { 8 9 class Cat10 {11 #region 猫叫事件12 public deleg... 阅读全文
posted @ 2012-03-26 18:06 David.Yang 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 1 public static string GetMacAddress() 2 { 3 ManagementClass class2 = new ManagementClass("Win32_NetworkAdapterConfiguration"); 4 foreach (ManagementObject obj2 in class2.GetInstances()) 5 { 6 if (obj2["IPEnabled"].ToString()... 阅读全文
posted @ 2011-09-21 10:27 David.Yang 阅读(4239) 评论(1) 推荐(0) 编辑
摘要: 1 /// <summary> 2 /// 浏览文件 3 /// </summary> 4 /// <param name="filePath"></param> 5 public static void ExploreFile(string filePath) 6 { 7 Process proc = new Process(); 8 proc.StartInfo.FileName = "explorer"; 9 //打开资源管理器10 ... 阅读全文
posted @ 2011-09-21 10:25 David.Yang 阅读(15489) 评论(0) 推荐(0) 编辑
摘要: 1 /// <summary> 2 /// 下载文件 TransmitFile 3 /// </summary> 4 /// <param name="filePath"></param> 5 public static void DownloadFile(string filePath) 6 { 7 string filename = HttpContext.Current.Server.MapPath(filePath); 8 var respo... 阅读全文
posted @ 2011-09-21 10:16 David.Yang 阅读(340) 评论(0) 推荐(0) 编辑
摘要: 非常有价值的一篇文章:http://www.sqlstudy.com/sql_article.php?id=2008060701其中关键之一,是 set xact_abort on 【个人认为这种用法最简单有效】如果应用 try catch ,需要结合以下系统函数在catch中取错误信息:ERROR_SEVERITY(), ERROR_STATE(), ERROR_NUMBER(),ERROR_PROCEDURE(), ERROR_LINE(), ERROR_MESSAGE()还有,在提交或回滚事务时, 判断 @@trancount>0 也很关键 , 否则容易出现嵌套事务时出错的问题. 阅读全文
posted @ 2011-08-15 17:11 David.Yang 阅读(1594) 评论(1) 推荐(1) 编辑
摘要: 1、打开弹出窗口时把 window 作为第二个参数传入。var result = window.showModalDialog(url, window, "dialogWidth=" + width + "px;dialogHeight=" + height + "px;resizable:yes;")if (typeof (result) == 'undefined') { result = window.ReturnValue; } return result;2、在弹出窗口中,执行如下JS,以接收传入的windo 阅读全文
posted @ 2011-07-29 17:19 David.Yang 阅读(7688) 评论(2) 推荐(3) 编辑
摘要: WatiN是开源的.net Web自动化测试工具。下文中记录了一些常见的问题的处理。感谢原作者。http://www.51testing.com/?uid-61753-action-viewspace-itemid-219961本人在使用WatiN时,发现其在IE9下,取Iframe中嵌套的Iframe里的控件时,产生错误。下了源码研究了一翻,貌似是IE的问题,这里希望有高人帮助解决。目前我采用执行JS的方法,绕过了此问题。 记录在此,希望对大家有帮助。 主要是在WatiN的源码Document类中增加了三个方法:1 /// <summary>2 /// 给iframe中的某控件赋 阅读全文
posted @ 2011-03-29 11:03 David.Yang 阅读(2283) 评论(18) 推荐(1) 编辑
摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1 if (window.navigator.appName == "Microsoft Internet Explorer") {2 if (!document.documentMode || document.documentMode < 8) {3 alert("请使用IE8以上版本!如果您启用了IE8的兼容模式,请您关闭它,以免不能正常使用系统!&qu 阅读全文
posted @ 2010-12-03 11:26 David.Yang 阅读(2287) 评论(1) 推荐(0) 编辑
摘要: 通过注入脚本实现查看选中内容HTML源代码的功能【目前似乎只有遨游支持此功能,调试页面时很轻盈好用的功能】Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1 private void MainForm_Load(object sender, EventArgs e)2 {3 wbMain.ObjectForScripting = this;4 wbMain.DocumentCompleted += new WebBrowserDocument 阅读全文
posted @ 2010-12-02 19:28 David.Yang 阅读(1771) 评论(1) 推荐(0) 编辑