異なるパラメータパターンを作成する必要があります。パラメータ:{string email、string phonenumber、string password}を持つStudent()構造体のインスタンスが必要な場合は、 を入力してください。インテリセンスのすべてのコンストラクタが表示されない
私は同じクラスの生徒用に2つのコンストラクタを作成して実装しようとしましたが、動作しません。最初のコンストラクタのパラメータ規定のみを提供します。
public struct student
{
private string username;
private string password;
public string Username
{
get { return username; }
set { username = value; }
}
public string Password
{
get { return password; }
set { password = value; }
}
public student(string username, string password)
{
this.username = username;
this.password = password;
}
public student(string username,string email,string phonenumber,string password)
{
this.password = password;
this.username = email;
}
}
これはこれが提供するものです。
1 of 2 options for the parameters
2 of 2 options for the parameters
"それは"それは "それは何"ですか? 「パラメータ規定」とは何ですか?あなたが電話番号と電子メールのプロパティを持っていないという事実以外に、あなたがやったことがうまくいくので、問題が何であるかを説明してください。 –
これに構造体の代わりにクラスを使用し、.NETの大文字と小文字の規則に従います。それを除けば、私はあなたのコードを試して、私はintellisenseですべてのコンストラクタを取得します。 –
画像が表示されたコードと一致しません。更新してください。 –