I assume you mean something like this
string x = "MyMachine";
string y = "YourMachine";
string na = System.Environment.MachineName;
switch (na)
{
case x:
}
I am afraid this is not possible. You will have to supply the proper string like this:
string na = System.Environment.MachineName;
switch (na)
{
case "MyMachine":
break;
case "YourMachine":
break;
}
If you could tell us more about what you would like to achieve we might be able to help more.
In answer to your comment, I would change this to use an If construct, something like this:
StreamReader srFrom = new StreamReader(@"your file path");
string na = System.Environment.MachineName;
string name = srFrom.ReadLine();
srFrom.Close();
if (na == name)
{
}
else
{
}
Hope this helps