-1
我有一個問題。所以我有這個問題,即if查詢不起作用。他會一直跳入其他路徑。但是,在該數據庫是一個條目,所以它不是空...reader.Read()總是空的......但爲什麼?
Jump:
string query = "SELECT * FROM `depositRequests` LIMIT 1";
MySqlCommand cmd = new MySqlCommand(query, connection);
MySqlDataReader reader = cmd.ExecuteReader();
Thread.Sleep(1000);
reader.Read();
Log.Info("Durchlauf: " + i);
if (reader.Read())
{
SteamID SteamAddID = new SteamID(reader.GetString(2));
string authCode = reader.GetString(3);
Log.Info("SteamAddID: " + SteamAddID);
Log.Info("AuthCode: " + authCode);
Bot.log.Success("Add SteamAddID: " + SteamAddID + "AuthCode: " + authCode);
AddFriendForTrade(SteamAddID, authCode);
}
else
{
Bot.log.Warn("No Data found! Waiting for Deposit Request");
Thread.Sleep(60000);
reader.Close();
i++;
goto Jump;
}
那麼,爲什麼他總是在別的路徑跳雖然在數據庫中的條目?
謝謝你的幫助!
你想與解決什麼樣的問題' Thread.sleep代碼(1000);'? [**'goto Jump' ??? **](http://xkcd.com/292/)有更好的選擇:'while(true){...;如果(條件)中斷; ...}'或'while(true){...;如果(條件)返回; ''。 OMG! –