가능한 중복 : 지난 두 검사에 표시 어떤 메시지 상자가없는 이유는호출되지 않은 경우. C#을
Match match = regex.Match(responseFromServer); if (match.Success) { var input = responseFromServer; var split = input.Split(':'); var final = split[3]; ProcessStartInfo mcStartInfo = new Shitocode; Process.Start(mcStartInfo); this.Close(); } else if (responseFromServer == " Bad Login") { MessageBox.Show("Uncorrect login/password!"); } else if (responseFromServer == " Old version") { MessageBox.Show("Launcher is old!"); }
나는 코드가?
if (match.Success)
{
var input = responseFromServer;
var split = input.Split(':');
var final = split[3];
ProcessStartInfo mcStartInfo = new Shitocode;
Process.Start(mcStartInfo);
this.Close();
}
else if (responseFromServer.Equals("Bad Login"))
{
MessageBox.Show("Uncorrect login/password!");
}
else if (responseFromServer.Equals("Old Version"))
{
MessageBox.Show("Launcher is old!");
}
내가 잘못된 암호를 입력하지만, 코드를 통해 이동
responseFromServer
의 값을 확인, 그냥 브레이킹을 설정 메시지 박스
을 변화시킬 수 debug 문을 추가하여'responseFromServer'가 무엇인지 확인하십시오 :'System.Diagnostics.Debug.WriteLine (responseFromServer);'그러면 else if 문이 좋은지 확인할 수 있습니다. – SynerCoder
응답에 대한 확신이 있습니까? 서버가 "Bad login"또는 ""Old Version ""에 응답하지 않을 수 있습니다. 그 코드를 디버깅 해보십시오. – ragatskynet
그럼 서버의 응답은 무엇입니까? – Jodrell