在 Visual Studio C# Express 上,当我运行下面的脚本时,我在行中收到以下错误消息:
if (ofd.ShowDialog() == true): 错误 1 运算符“==”不能应用于“System.Windows.Forms.DialogResult”和“bool”类型的操作数
我怎么能解决这个问题?下面的代码:
public override GH_ObjectResponse RespondToMouseDoubleClick(GH_Canvas sender, GH_CanvasMouseEvent e)
{
System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog();
ofd.Multiselect = true;
ofd.Filter = "Data Sources (*.ini)|*.ini*|All Files|*.*";
if (ofd.ShowDialog() == true)
{
string[] filePath = ofd.FileNames;
string[] safeFilePath = ofd.SafeFileNames;
}
return base.RespondToMouseDoubleClick(sender, e);
}