摘要: 关于C# USING关键字,主要有三种用法,分别为 using指令,using别名 和 using语句(定义一个范围,在范围结束时处理对象)。具体使用场景及注意事项详述如下:1. Using别名using + 命名空间名字,这样可以在程序中直接用命令空间中的类型,而不必指定类型的详细命名空间,类似于Java的import,这个功能也是最常用的,几乎每个cs的程序都会用到。例如:usingSystem; usingSystem.Data;2. Using别名using + 别名 = 包括详细命名空间信息的具体的类型。这种做法有个好处就是当同一个cs引用了两个不同的命名空间,但两个命名空间都包.. 阅读全文
posted @ 2013-07-26 10:54 Blackeye 阅读(283) 评论(0) 推荐(0)
摘要: Timer作为一个计时控件,在开发过程中被频繁的使用。但一直不是很清楚.NET中存在3个命名空间下Timer的区别分别是什么。因而在网上搜索了一下并做一下小小的总结以防忘记。1. Timer 类型 .System.Windows.Forms.Timer --是基于UI的.实现按用户定义的时间间隔引发事件的计时器。 .System.Timers.Timer --是基于服务,在应用程序中生成定期事件。 .System.Threading.Timer --是基于线程,提供以指定的时间间隔执行方法的机制.2. 总结 System.Threading.Timer 是一个简单的轻量计... 阅读全文
posted @ 2013-07-26 10:21 Blackeye 阅读(415) 评论(0) 推荐(0)
摘要: IntroductionIt is normal practice to open the Windows command prompt and execute commands. The command when executed shows the result onto the screen. There are many commands that we execute daily such as dir, find, etc. A situation may arise when you want to execute a (shell) command from the C# ap 阅读全文
posted @ 2013-07-24 15:30 Blackeye 阅读(250) 评论(0) 推荐(0)
摘要: A good artical introduce how to create and install Windows service via C#. The artical link is attached for future refer.http://www.cnblogs.com/wuhuacong/archive/2009/02/11/1381428.htmlCall a program via Windows service is not easy as we used before. We cannot use Process to launch an program with U 阅读全文
posted @ 2013-07-23 11:12 Blackeye 阅读(719) 评论(0) 推荐(0)
摘要: 1 ) Set Access ControlDirectoryInfo dInfo = new DirectoryInfo(fileName);DirectorySecurity dSecurity = dInfo.GetAccessControl();dSecurity.AddAccessRule(new FileSystemAccessRule("everyone",FileSystemRights.FullControl, InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit,Propag 阅读全文
posted @ 2013-07-23 11:03 Blackeye 阅读(1563) 评论(0) 推荐(0)
摘要: 两年没Coding了,终于在换新公司之后可以重新把Code捡起来,很庆幸有公司可以给我这个机会做自动化测试工具开发。接收的第一份任务就是做Windows平台上 一款产品的最动化BVT测试,测试技术主要是用微软提供的自动化测试框架UIA,因而就从网上找了很多博客看了下,并自己重新总结了一下,希望自己不要忘记同时也记录一下自己的工作学习过程。1. UI Automation Introduction1.1 OverviewUI Automation是Microsoft .NET 3.0框架下提供的一种用于自动化测试的技术,是在MSAA基础上建立的,MSAA就是Microsoft Active .. 阅读全文
posted @ 2013-06-24 17:46 Blackeye 阅读(1012) 评论(0) 推荐(1)
摘要: 在VS集成环境中能够执行的测试代码,在一般程序中也能够执行。问题关键是如何在程序中配置好CUIT测试执行的环境,即CUIT回放执行引擎是否正确启动。当使用VS的CUIT工程时,每个测试类都被标识了[CodedUITest],当VS的Mstest测试引擎在执行每个测试用例的时候,它会自动读取测试所配置的属性,以判断测试的类型,当它看到是CodedUITest后,它会自动初始化CUIT的底层回放(Playback)执行引擎,让后执行该测试用例。自己创建的程序无法直接使用CodedUIAttribute和Mstest,需要Playback.Initialize()/Playback.Cleanu.. 阅读全文
posted @ 2013-05-29 09:50 Blackeye 阅读(381) 评论(0) 推荐(0)
摘要: How to add custom AppBarLike Other contols, AppBar is also under nmaespace of "Windows.UI.Xaml.Controls", and it just a simple ContentControl.The member of AppBar is also very simple, IsOpen and IsStick represents whether open or not and whether not hide automatical. And we can use events 阅读全文
posted @ 2013-01-09 16:43 Blackeye 阅读(172) 评论(0) 推荐(0)
摘要: [转]cmd删除、添加、修改注册表命令在CMD命令行下修改Windows注册表方法及Hiv技术注册表regedit的未公开的参数的 可以在cmd下使用.regedit的运行参数REGEDIT [/L:system] [/R:user] filename1 REGEDIT [/L:system] [/R:user] /C filename2 REGEDIT [/L:system] [/R:user] /E filename3 [regpath] /L:system Specifies the location of the SYSTEM.DAT file. /R:user Specifies t 阅读全文
posted @ 2013-01-06 16:33 Blackeye 阅读(409) 评论(0) 推荐(0)
摘要: Time files, it's almost two years since I have graduated. But I never improved myself almost. To be a tester is not my original idea but I did. I am very confused what I want to be in future and what I can do to make a living in Beijing? I don't like testing work especially for manual testin 阅读全文
posted @ 2013-01-01 17:21 Blackeye 阅读(264) 评论(0) 推荐(1)