日期:2014-05-17  浏览次数:20958 次

平台wince 选择智能设备 c#语言开发 改错
private void button1_Click(object sender, EventArgs e)
  {
  // string str = Convert.ToString(result1);
  // string str = result1.ToString();
  double before;
  string str = textBox1.Text;
  if ((str.Length - 1) != 0)
  {
  if (textBox1.Text.Contains("."))
  {
  a = a / 10;
  }
  str = str.Substring(0, str.Length - 1);
  // double en = double.Parse(str); //str.ToString() c#当中的局部变量
  if (OPT.Equals(""))
  {
  before = result1;
  if (double.TryParse(str, out before)) { }
  else { }
  result1 = before;
  }
  else
  {
  before = result2;
  if (double.TryParse(str, out before)) { }
  else { }
  result2 = before;
  }

  // result1 = en;
  textBox1.Text = str;
  }
  else
  {
  textBox1.Text = "0";
  }

  }


下面是错误
------ 已启动生成: 项目: DeviceApplication2, 配置: Debug Any CPU ------
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE;WindowsCE /reference:"E:\xp install\vs 2005 install\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\mscorlib.dll" /reference:"E:\xp install\vs 2005 install\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\System.Data.dll" /reference:"E:\xp install\vs 2005 install\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\System.dll" /reference:"E:\xp install\vs 2005 install\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\System.Drawing.dll" /reference:"E:\xp install\vs 2005 install\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\System.Windows.Forms.dll" /reference:"E:\xp install\vs 2005 install\SmartDevices\SDK\CompactFramework\2.0\v2.0\WindowsCE\System.Xml.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\DeviceApplication2.exe /resource:obj\Debug\DeviceApplication2.Form1.resources /resource:obj\Debug\DeviceApplication2.Properties.Resources.resources /target:winexe Form1.cs Form1.Designer.cs Program.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs
g:\Visual Studio 2005\Projects\DeviceApplication2\DeviceApplication2\Form1.cs(370,35): 错误 CS0117: “string”并不包含“Contains”的定义
g:\Visual Studio 2005\Projects\DeviceApplication2\DeviceApplication2\Form1.cs(379,32): 错误 CS0117: “double”并不包含“TryParse”的定义
g:\Visual Studio 2005\Projects\DeviceApplication2\DeviceApplication2\Form1.cs(386,32): 错误 CS0117: “double”并不包含“TryParse”的定义

编译完成 -- 3 个错误,0 个警告
========== 生成: 0 成功或最新,1 失败,0 被跳过 ==========

那个能我改改,求大神指教

------解决方案--------------------
不知道,顶帖子看看