我有一个按钮,路径保存到一个文件夹中的一个文本框中的文本,我想将它保存在C#中的设置文件,但我不断收到错误:将路径转换为字符串?
Cannot implicitly convert type "System.windows.type.textbox" to String
现在代码我使用设置文本框的路径是:
folderBrowserDialog1.ShowDialog();
textBox1.Text = folderBrowserDialog1.SelectedPath;
而且我使用它保存到设置文件的代码是:
string pathh = textBox1;
Properties.Settings.Default.Path = textBox1;
即使我更换
Properties.Settings.Default.Path = textBox1
Properties.Settings.Default.Path = pathh
我得到了同样的错误。有人能告诉我如何解决这个问题吗?