我有下面的代码让我的IP地址的第三个八位不能隐式转换类型字节在IF语句为bool
//这些都是一类的地方
public static string HostName = Dns.GetHostName();//get HOSTNAME
public static string myIP = Dns.GetHostEntry(GlobalVars.HostName).AddressList[3].ToString();// Get the IP
public static byte myIP3 = IPAddress.Parse(myIP).GetAddressBytes()[2];//Gets third octet of IP
声明全局变量我然后要按照以下步骤创建一个IF语句,但收到错误:
if (GlobalVars.myIP3= 92){
GlobalVars.Sitecode = "SiteA"
}
? ;-) –