bool _setStaticIP(string static_ip) { bool ret = false; int count = 0; //get logsytem var prop_logsystem = testingInfo.GetType().GetProperty("logSystem"); string log_value = (string)prop_logsystem.GetValue(testingInfo); //set static ip log_value += string.Format("\n-------------------------------\n"); log_value += string.Format("{0}, set static ip\n", DateTime.Now); prop_logsystem.SetValue(testingInfo, log_value); count = 0; RE_SET: count++; ret = camera.setStaticIP(static_ip); if (!ret) { if (count < 3) { goto RE_SET; } } return(ret); }