CS0111 C#type'form1'已经定义了一个名为'.ctor'的成员,它具有相同的参数类型 [英] CS0111 C# type 'form1' already defines a member called '.ctor' with the same parameter types
问题描述
使用System;
使用System.Collections.Generic;
使用System.Linq;
使用System.Threading.Tasks;
使用System.Windows.Forms;
使用System.Data;
使用System.Drawing;
使用System .Text;
使用System.Diagnostics;
名称空间ExucuteBatFile
{
公共部分类Form1:表格
{
public Form1()
{
}
private void button1_Click(object sender,EventArgs e)
{
流程proc = null;
尝试
{
string batDir = string.Format(@D:\ EWA \ TABLESPACE);
proc = new Process();
proc.StartInfo.WorkingDirectory = batDir;
p roc.StartInfo.FileName =JOB_TABLESPACE.bat;
proc.StartInfo.CreateNoWindow = false;
proc.Start();
MessageBox.Show(Bat telah di executable !!);
}
catch(Exception ex)
{
Console.WriteLine(ex.StackTrace.ToString());
}
}
}
}
我尝试了什么:
c #error Type' Form1'已经定义了一个名为'.ctor'的成员,其参数类型相同
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data;
using System.Drawing;
using System.Text;
using System.Diagnostics;
namespace ExucuteBatFile
{
public partial class Form1 : Form
{
public Form1()
{
}
private void button1_Click(object sender, EventArgs e)
{
Process proc = null;
try
{
string batDir = string.Format(@"D:\EWA\TABLESPACE");
proc = new Process();
proc.StartInfo.WorkingDirectory = batDir;
proc.StartInfo.FileName = "JOB_TABLESPACE.bat";
proc.StartInfo.CreateNoWindow = false;
proc.Start();
MessageBox.Show("Bat telah di executable !!");
}
catch(Exception ex)
{
Console.WriteLine(ex.StackTrace.ToString());
}
}
}
}
What I have tried:
c# error Type 'Form1' already defines a member called '.ctor' with the same parameter types
推荐答案
这是部分
class - 这意味着它分布在多个文件中。
使用Visual Studio执行查找操作:
打开编辑菜单,然后查找和替换 ...在文件中查找
在查找内容下键入Form1并选择查找成为当前项目
点击查找全部按钮。
在查找结果窗口中,您将获得所引用的所有地点的列表 - 检查构造函数的数量(你可以双击一行直接到它)
你将有两个具有相同参数列表的构造函数。
This is apartial
class - which means that it is spread across multiple files.
Use Visual Studio to do a Find operation:
Open the "Edit" menu, then the "Find and Replace" ... "Find in Files"
Under "Find what" type "Form1" and select "Look in" to be "Current project"
Click the Find All Button.
In the "Find Results" window you will get a list of all the places it is referenced - check the number of constructors (you can double click a line to go directly to it)
You will have two constructors with the same parameter list.
这篇关于CS0111 C#type'form1'已经定义了一个名为'.ctor'的成员,它具有相同的参数类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!