System.FormatException HResult=0x80131537 Message=输入字符串的格式不正确。 Source=mscorlib StackTrace: 在 System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt) 在 System.Convert.ToDouble(String value) 在 C
代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CalculateDistance
{
public delegate void TransfDelegate(String value);
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
InitializeComponent();
}
public event TransfDelegate TransfEvent;
private void btnCalculate_Click(object sender, EventArgs e)
{
//触发事件
TransfEvent(Dis.Text);
this.Close();
double d = Convert.ToDouble(Dis.Text);// System.FormatException: 输入字符串的格式
}
}
}