このコードは1回だけ機能します。つまり、ユーザーがオンラインになってオフラインになった場合です。常に情報を提供し続けるようなループを作りたいです。例:オンライン11:00、オフライン11:30、オンライン11:45、オフライン12:00。
どうすれば修正できますか?
bool showed =false;
bool nshowd =false;
for (; ; )
{
//chech_online() <- this methods gives true if the person is online on FB
bool check_online =check_online();
if(check_online ==true && !showed)
{
Console.WriteLine("Online !!" +DateTime.Now);
showed = true;
}
else if(check_online ==false && !nshowd)
{
Console.WriteLine("OFFline !!" + DateTime.Now);
nshowd = true;
}
}