I am trying to handle a simple structure. All that i need to have all variables right in the structure which are later gonna be used as a connection string. I am not going to assign any new values to the listed variables. I know how to do the same with classes but now i wish to discover how to hit is with structs. Also, i don't need these parameters string p1 etc in the constructor but without them, i am getting an error. Please help)
public struct ConnectionString
{
// vars declaration
public string ip, login, password;
// struct constructor
public ConnectionString(string p1, string p2, string p3)
{
ip = "192.168.1.1";
login = "boris";
password = "123456";
}
}
But when i call it, i've got an empty output:
ConnectionString ss = new ConnectionString();
Console.WriteLine("connection string: " + ss.password);