苯苯的博客

新随笔 联系 管理
  21 Posts :: 0 Stories :: 3 Comments :: 0 Trackbacks

2008年11月6日 #

原文:

Essential Visual Studio Tips & Tricks that Every Developer Should Know

http://weblogs.asp.net/stephenwalther/archive/2008/10/21/essential-visual-studio-tips-amp-tricks-that-every-developer-should-know.aspx

我的技巧总结:

1. 工具:

Microsoft Visual Studio 2008
Version 9.0.21022.8 RTM
Microsoft .NET Framework
Version 3.5

Installed Edition: Enterprise

2. 技巧:(全部左手操作,和打魔兽的感觉一样)

  • 如果你想复制一行代码(超级长,鼠标拖老久的),只需要在这行的空白处 CTRL+C。
  • 同理,删除或者剪贴一行CTRL+X。
  • 如果想复制一段在{}的代码,直接在头或者尾 CTRL+C.
  • 自动加namespace, CTRL+.
  • 显示方法里的参数 CTRL+SHIFT+space. 以前每次都是手动删括号。汗!
  • 自动排版 CTRL+E,D.  (位置:在Edit-->Advanced-->Formated Document )这个是我最常用的
  • 自动注释 CTRL+E,C.  ( 位置:在Edit-->Advanced-->Comment Selection )
  • 自从知道了Tab+Tab,可以调出代码段,我就经常用Try+Tab+Tabe.再也不用写Try..catch了。

还有其他的技巧在原文里看看就好了。

posted @ 2008-11-06 08:41 one 阅读(19) | 评论 (0)编辑

2008年10月13日 #

一个人的实际能力才是企业所真正看重的。
It is one's practical capability that enterprises truly value.

我认为我们发明一种新的语言来取代英语是没有必要的.
I don't think it necessary to invent a new kind of language to take the place of English.

 

然而,关于它是一件好事还是坏事,人们有不同的态度。

People, nevertheless, hold various opinions in terms of the issue whether it is a blessing or a curse.

 

很多国家的失业率在不断攀升这一事实是我们无法否认的。
The fact that the unemployment rates in quite a number of countries keep rising can not be denied .

在给出我的观点之前,我认为看一看问题的两面是很重要的。
I hold it essential to examine the both sides of the issue before presenting my viewpoint.

不同的人们对于全球化是否有利于经济的发展这个问题持有不同的看法.  

Different people hold various viewpoints as to the issue whether globalization is beneficial to the economic development.
 

令人感到遗憾的是大多数人所在乎的仅仅就只是他们怎么样才能更多地赚到钱。

It is a pity that all the majority of people care about is how they could be paid more.
  

随着越来越多的妇女参与全职工作,由谁来照顾孩子已经成为了社会上的一个问题。

With increasing number of women taking part in full-time jobs, who should take care of children has become a social issue.

posted @ 2008-10-13 09:41 one 阅读(35) | 评论 (0)编辑

2008年8月11日 #

 

 public static string GetCaseMethodName()
        
{
            
try
            
{
                StackTrace st 
= new StackTrace();
                StackFrame[] stackFrames 
= st.GetFrames();
                
foreach (StackFrame sf in stackFrames)
                
{
                    MethodBase mb 
= sf.GetMethod();
                    
if (mb.GetCustomAttributes(typeof(TestMethodAttribute), false).Length > 0)
                        
return mb.Name;
                }

                
return string.Empty;
            }

            
catch throw; }
        }
posted @ 2008-08-11 03:50 one 阅读(8) | 评论 (0)编辑

2008年7月22日 #

     摘要: 最近做了个小项目,然而却又遭遇了半年前项目开发的噩梦--无休止的琐碎的修改。不止一次大声呼喊“准确的需求分析”,然而客户总爱打理不理,出了问题更是动懂嘴唇-"改"。   阅读全文
posted @ 2008-07-22 07:29 one 阅读(34) | 评论 (0)编辑

2008年7月10日 #


RE:

I got this when I renamed my C# project then tried to publish it. To solve, I went to the "Signing" tab of the project properties and unchecked "Sign the ClickOnce manifests".

Good luck!

 

 

posted @ 2008-07-10 04:11 one 阅读(55) | 评论 (0)编辑

2008年7月8日 #

A static method is simply one that is disassociated from any instance of its containing class. The more common alternative is an instance method, which is a method whose result is dependent on the state of a particular instance of the class it belongs to.

For example, both of these statements would return precisely the same string, but accomplish it through different types of methods:

// ToString() is an instance method of the DateTime class.
//  Its result depends on the value of each DateTime instance.
return DateTime.Now.ToString();
 
// String.Format is a static method of the String class.
//  Its result is not related to any instance of the String.
return String.Format("{0}", DateTime.Now);

The key difference to understand is that a static method can be called without setting up a proper instance of the class it belongs to.

In a sense, it is a stateless method.

posted @ 2008-07-08 04:20 one 阅读(15) | 评论 (0)编辑

The final advantage of using const over readonly is performance: Known
constant values can generate slightly more efficient code than the variable
accesses necessary for readonly values. However, any gains are slight and
should be weighed against the decreased flexibility.
Be sure to profile
performance differences before giving up the flexibility.


const must be used when the value must be available at compile times:
attribute parameters and enum definitions, and those rare times when
you mean to define a value that does not change from release to release.
For everything else, prefer the increased flexibility of readonly constants.

posted @ 2008-07-08 04:08 one 阅读(14) | 评论 (0)编辑

2008年6月30日 #

1)More and more people use the mobile phone or computer to communicate, and no longer write letters to each other. Some people think the skills of letter writing will soon disappear completely. Do you agree or disagree? How important do you think letter-writing is?

In the new millennium, rapid developed telecommunication technology makes our lives much easier and faster than ever before, inducing a large scale sweeping trend that the proliferation of mobile phones and computers is increasingly popular. In this case, whether the traditional letter should be replaced by such modern techniques has aroused severe debate,and some even claim that the skills of letter will disappear completely. Speaking for me, I totally disagree with this view.


In this day and age, the traditional means of writing a letter still plays a pivotal role and its advantages cannot be neglected. To begin with, not only writing a letter is to transfer information, but it represents a more sincere feeling as well- that is to say, a traditional letter transfers some feelings of sender, be it happy or sorry, angry or love, rather than merely simple words to the receiver. To illustrate, it is usual that companies would like to send formal invitation letters to guests for conferences and lovers would like to write love letters to each other. In addition, considering about the increasingly severe disparity between cities and countryside, some basic infrastructures such as signal base stations and broadband are unavailable in rural areas and numerous people still cannot afford the cost of a mobile phone and computer, thus letters and post offices are still an indispensable part of the communication network.

Admittedly, modern technology like SMS or MSN or email exert certain effects to increase efficiency, as it cut down the time wasted in transferring the message. However, such fast and convenient operations render people less careful about their words and expressions, resulting in a great many wrongly spelled characters or unsuitable sentences, which will, in turn, make misunderstanding or even degradation of the language. In contrast, when writing a letter, people will pay more attention to their words and carefully think about the contents.

In conclusion, mobile phones or computers can increase efficiency in modern society, but they will never render the traditional writing skills outdated. Letter writing can help us concentrate on the contents, reduce the cost of deploying facilities and above all, directly and effectively show our feelings.

posted @ 2008-06-30 02:52 one 阅读(42) | 评论 (0)编辑

2008年6月5日 #

积极方面  

1. give students/ citizens motivation to…给学生/公民动力去……
2. narrow the gap between the wealthy and the impoverished 减少贫富差距
3. curb crimes 控制犯罪
4. allocate money to投资于…
5. promote the development of… 促进…的发展
6. It is obvious that…显而易见,…
7. play a key role in 起关键作用  
8. enhance the efficiency of…提高效率
9. enrich one’s experience …丰富某人的经验
10. keep society safe and stable 保持社会稳定
11. have an obligation to do …有责任去…
12. afford people entertainment and pleasure 给人们提供娱乐
13. create employment opportunities   创造就业机会
14. put something in the first place = give priority to… 把…当成首要任务
15. is less time-consuming and more economical 省钱又省时间
16. broaden one’s horizons 开阔人的眼界
17. contribute to … 为…作贡献
18. fulfill one's potential 发挥......的潜力

消极方面

19. live a stressful life生活压力大
20. the competition is stiff 竞争激烈
21. impair people’s health 破坏人的健康
22. the population is booming 人口爆炸
23. restrict the development of 限制……的发展
24. lower the efficiency of… 降低……的效率
25. stem from 某事由…导致
26. suffer from 遭受
27. is a threat to… 对…构成威胁
28. have detrimental influence upon  对…产生有害的影响
29. cope with  解决,处理
30. take measures to … 采取措施…
31. There is a definite link between A and B     A和B之间有密切的联系
32. is increasingly severe 越来越严重
33. is monotonous 单调的
34. create psychological problems 产生心理问题

posted @ 2008-06-05 08:42 one 阅读(32) | 评论 (0)编辑

2008年4月18日 #


同事小朱在非正常状态下写下的代码:

1.构造函数给类的Property创造实例。
正常版:
 public class Parameters
    
{
        
public Parameters()
        
{
            Server 
= new KeyValue();
        
        }

       
        
public KeyValue Server getset; }
     }
无奈版:
1 public Parameters()
2        {
3            foreach (PropertyInfo pi in this.GetType().GetProperties())
4            {
5                pi.SetValue(this, Activator.CreateInstance(pi.PropertyType), null);
6            }

7        }
posted @ 2008-04-18 09:42 one 阅读(24) | 评论 (0)编辑