String   类提供的   GetHashCode   实现为唯一的字符串值返回唯一的哈希代码"       
  人家MSDN说的意思是,如果一个字符串是确定的,那么它的HashCode也确定   
  而不会改变(相同的.NET   版本情况下)


就是用随机数生成字符串,放到Hashtable中   ,  直到发现重复的HashCode.
  using   System;  
  public   class   test  
  {  
      static   void   Main()  
      {  
                    //   .net   1.1  
      Console.WriteLine("0.883744205759719".GetHashCode());  
      Console.WriteLine("0.125208284298521".GetHashCode());  
   
                    //   .net   2.0  
      Console.WriteLine("0.89265452879139".GetHashCode());  
      Console.WriteLine("0.280527401380486".GetHashCode());  
      }  
  }  

http://topic.csdn.net/t/20051118/09/4401612.html
posted on 2008-05-02 11:07  una  阅读(451)  评论(0编辑  收藏  举报