Automate Everything

关于自动化相关的任何东西,包括自动化测试,Visual Studio宏, 自动化安装部署等

Archive for the ‘技巧’ Category

你是否知道- 你可以在Object Browser中直接添加References

星期四, 05月 8th, 2008

转自:

Did you know… You can add references to your solution directly from the Object Browser - #210

一般我们添加Reference都是通过打开Sulution Explorer,在Reference文件夹或者Project节点上点击右键,选择添加引用,然后在添加引用的对话框里边选择引用。

让我们看看其它的方法怎么做: 在Object Browser的工具栏上有一个按钮叫做‘Add To References’

 ObjectBrowserAddReference_6

然后你可以看到’Accessibility’已经被添加到了工程中

ObjectBrowserAddReference2_2

把这篇文章分享到: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • bodytext
  • Google
  • Facebook
  • Furl

55招玩转Google

星期三, 04月 23rd, 2008

转一本很好的书:http://www.yangyc.com/55fun/

章节目录

  1. 用Google找自己
  2. Google贪吃蛇
  3. 枚枚页:适者生存
  4. Google愤怒症游戏&Google图像小测试
  5. Google谚语进行时
  6. 浏览网站的全部图片
  7. Google运动简史
  8. Google是什么?它为何有趣?
  9. Google为我们节约了多少时间?
  10. Google帮你做柠檬鸡
  11. 道格拉斯•亚当斯和Google计算器
  12. Oops,我又Google了一把
  13. 小魔术:Google图标大变身
  14. Wiki上的趣味Google Maps玩法
  15. 德夫-多曼的Googlewhack
  16. Google你问我答
  17. 庆祝非婚礼,及其它
  18. 用SketchUp设计你的梦想之家

  19. 凯文·培根和Google关系网
  20. Google字母表
  21. Google搜索小贴士
  22. Google公园
  23. GoogleShare
  24. 最短和最多的Google搜索
  25. 旋转Google和迷你Google
  26. Google小测试:你有多了解Google?
  27. 根据记忆重绘Google
  28. Google News怪现象
  29. 外星人入侵Google!
  30. Google沉溺症的十个症状
  31. 凿个穿透地球的洞
  32. Googlebombing
  33. Google广告洋相大观
  34. G世代的生活
  35. Google黑客
  36. Google调查: 问问大家的意见
  37. Google大战游戏
  38. 如果Google作恶了会如何?附:未来Google的5项发明【上】|【下】
  39. Google冒险游戏
  40. Egobot, 来自网络的声音
  41. 有趣的Google小玩意
  42. 科幻时间【1/4】_杰克寻母记
    科幻时间【2/4】_事故:页面等级值为100
    科幻时间【3/4】_网络大脑
    科幻时间【4/4】_Google机器人常见问答
  43. Google世界记录之书
  44. 拼写错误仓库
  45. Google 网上论坛,时间机器
  46. ……翻译进行中……
把这篇文章分享到: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • bodytext
  • Google
  • Facebook
  • Furl

你是否知道-怎么从命令行编译(build)一个解决方案(Solution)

星期一, 04月 14th, 2008

转载自:Did you know… How to build a solution from the command line

建议使用Visual Studio 2005 Command Prompt来运行所有的命令
你可以从开始菜单-> 所有程序 –> Microsoft Visual Studio 2005 –> Visual Studio Tools来运行Visual Studio 2005 Command Prompt,这样你就不需要担心怎么设置正确的环境变量,比如PATH

试试输入Devenv /?
从命令行的输出,你可以看到这个命令的帮助,你需要用这些来进行编译

在命令行的帮助,你可以看到这个示例:
devenv solutionfile.sln /build solutionconfig [ /project projectnameorfile [ /projectconfig name ] ]

上边的命令可以简化为:
devenv <solutionname> /build

你同样可以制定解决方案(Solution)的配置和工程配置。你可以使用Build->Configuration Manager来创建一个新的工程和解决方案的配置来进行编译。例如:
devenv <solutionname> /build "Debug|Any CPU" /project <projectname> /projectconfig “Debug|Any CPU”

最后一点,你可以指定将编译的日志写在什么地方:
devenv <solutionname> /build "Debug|Any CPU" /project <projectname> /projectconfig “Debug:Any CPU” /out <filename>

把这篇文章分享到: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • bodytext
  • Google
  • Facebook
  • Furl

你是否知道-你可以调整‘自动完成’(Statement Completion)窗口的大小

星期一, 04月 14th, 2008

转载自:Did you know… you can resize the statement completion window? - #059

是的,你可以往任意方向调整‘自动完成’窗口的大小:

注:

  • 最大高度:1/3屏幕高度
把这篇文章分享到: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • bodytext
  • Google
  • Facebook
  • Furl

你是否知道-VisualStudio中怎么使用工程模板

星期一, 04月 14th, 2008

转载自:Did you know… How to use Project Templates

什么是工程模板(Project Templates)?

工程模板就是一个简单的工程,你可以使用它创建一个新的工程,比如:Windows Applications, Class Libraries, WebSites等等。对Visual Studio2005 (开发代号Whidbey)中,模板作为一个单独Zip文件存储在硬盘上。Visual Studio会默认安装一些模板在:<Program Files>\Microsoft Visual Studio 8\Common7\IDE\ProjectTemplates 和 <Program Files>\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates

对于用户(任何人)创建的模板,存储在My Documents\Visual Studio 2005\Templates. 如果你想添加一个用户创建的模板到VS的模板列表,你需要做:
1. 拷贝模板(一个模板的Zip文件)到默认的位置(针对不同VS语言版本可能不太一样)
2. 在命令行(VS的命令行)运行devenv /installvstemplates
    注:貌似拷贝到My Documents\Visual Studio 2005\Templates就可以用了

Visual Studio2005也支持内含多个工程的模板,你可以到Craig’s的博客来详细了解:
http://blogs.msdn.com/craigskibo/archive/2004/10/08/240134.aspx

怎么创建用户模板?

一个最简单的方式就是使用‘导出模板向导’。首先,创建一个Class Library工程,然后给工程添加一个图标(这一步其实你可以做任何事情,你对工程做的任何改变都会保存在模板中)。然后点击菜单‘文件->到处模板。向导首先会问你是否要创建一个工程模板还是Item模板。它还会询问你希望基于那个工程来创建这个模板。下一个页面我们可以自定义我们的工程模板,我们可以修改工程模板的名称和描述,还有一个选项问你是否立即导入模板到Visual Studio中(其实也就是自动拷贝模板文件到My Documents\Visual Studio 2005\My Exported Templates to My Documents\Visual Studio 2005\Templates\Project Templates),设置好其它选项,按完成按钮,工程模板就创建好了。

.vstemplate文件中有什么?

注:当我们解压工程模板的zip包后,可以看到整个工程的所有文件,区别于正常的工程,这里多了一个.vstemplate文件,

下边我们来看一下这个文件是做什么用的
这个.vstemplate是特定于你这个工程模板的xml文件,它包含了比如模板的名称、描述等,第二部分包含了一些引用了什么文件的信息。
下边是一个典型的.vstemplate文件(我自己创建的,工程名字是AUTDefinition):

   1: <VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Project">
   2:   <TemplateData>
   3:     <Name>AUTDefinition</Name>
   4:     <Description>Create the AUT definitioin class library</Description>
   5:     <ProjectType>CSharp</ProjectType>
   6:     <ProjectSubType>
   7:     </ProjectSubType>
   8:     <SortOrder>1000</SortOrder>
   9:     <CreateNewFolder>true</CreateNewFolder>
  10:     <DefaultName>AUTDefinition</DefaultName>
  11:     <ProvideDefaultName>true</ProvideDefaultName>
  12:     <LocationField>Enabled</LocationField>
  13:     <EnableLocationBrowseButton>true</EnableLocationBrowseButton>
  14:     <Icon>__TemplateIcon.ico</Icon>
  15:   </TemplateData>
  16:   <TemplateContent>
  17:     <Project TargetFileName="UICalculator.csproj" File="UICalculator.csproj" ReplaceParameters="true">
  18:       <ProjectItem ReplaceParameters="true" TargetFileName="AUT.cs">AUT.cs</ProjectItem>
  19:       <Folder Name="Properties" TargetFolderName="Properties">
  20:         <ProjectItem ReplaceParameters="true" TargetFileName="AssemblyInfo.cs">AssemblyInfo.cs</ProjectItem>
  21:       </Folder>
  22:     </Project>
  23:   </TemplateContent>
  24: </VSTemplate>

把这篇文章分享到: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • bodytext
  • Google
  • Facebook
  • Furl

你是否知道-你可把代码段拖拽到Toolbox里边

星期五, 04月 11th, 2008

转载翻译自:Did you know… You can drag and drop code onto the Toolbox General tab? - #191

今天的小提示很有意思,特别是如果你在给别人做演示的时候。所有的人都看到你没有写任何代码,但是实际上代码已经准备好了:),让我们看一下如何做吧:

你可以已经注意到Toolbox的General页在你编辑代码的时候默认显示如下:
ToolboxGeneralTab_thumb

其实你可以拖拽代码段到这个地方,在然后需要的时候再拖拽回来,不明白的看下图:
ToolboxGeneralTab2_thumb

把这篇文章分享到: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • bodytext
  • Google
  • Facebook
  • Furl