984437(NewStar) ,能告诉我语句怎么写吗?

解决方案 »

  1.   

    用Convert.ToDouble()或者double.TryParse(),double.Parse()
      

  2.   

    1.(double)TextBox1.Text2.Convert.ToDouble(TextBox1.Text)
      

  3.   

    用C#中的隐式转换或用(int)TextBox1.Text
                         即(数据类型)控件名.Text
      

  4.   

    哥们,TheAres(班门斧)有更好的方法,小弟就不献丑了。
      

  5.   

    自己些一段不得了
    int i=0,j;
    double X=0,Y=0;
    string S=textBox1.Text;
    while (i<S.Length&&S[i]!='.')  
        X=X*10+(double)S[i++]-48;
    for (j=i+1;j<S.Length;j++)  
        Y+=(double)S[j]-48*Math.Pow(10,i-j);    
    X+=Y;
      

  6.   

    try
    {
    string a=textBox1.Text;
    long b=Convert.ToInt64(a);
    Console.WriteLine(b);
    }
    catch(Exception exce)
    {
    MessageBox.Show(exce.Message);

    }