ASCII  字符串转换为 double 值
大家好:   
          小弟用   SerialPort.ReadByte()   读取COM1   的一组ASCII字符.保存到   buff 
 (int   []   buff   =   new   int[8]   )   
             内容为      buff   =    "   128.66    "      //   ASCII   字符串   
             请问怎样将这个字符串转为   double   的   128.66   值呢?   谢谢!
------解决方案--------------------char[] buff = new char[] {  '1 ', '2 ',  '8 ',  '. ',  '6 ',  '6 ' }; 
             string s = new string(buff);   
             double d = double.Parse(s);     
 ***************************************************************************** 
 欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码)    
 最新版本:20070212   
 http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
------解决方案--------------------char[] buffer = new char[8]; 
 //SerialPort.ReadByte() int是4个字节并不是byte,ReadByte用char更好 
 string str = new string(buffer); 
 double d = double.Parse(str);
------解决方案--------------------byte[] buff = new byte[8]; 
 //用byte[]这样处理 
 double.Parse(Encoding.ASCII.GetString(buff));