var send = string.Empty; ((Action)(() => Timer.Once(4, () => { send = web.GetWithSsl(url); })))(); var sendDeserialize = JsonHelper.Deserialize<RootObject>(send);\ 

What did I do wrong? Essence: to perform var sendDeserialize and other actions after completing Timer.Once - sending a Get request to the site.

If I use this scheme

 var send = string.Empty; Timer.Once(4, () => { send = web.GetWithSsl(url); }); var sendDeserialize = JsonHelper.Deserialize<RootObject>(send); 

runs BEFORE web.GetWithSsl.

  • For reference : stackoverflow.com/q/554290/178779 . There is javascript, but the principle is the same. - Pavel Mayorov
  • @PavelMayorov I didn’t learn java so I don’t understand that code :( - MeshBenth
  • So write your code right after GetWithSsl or what's the problem? - tym32167
  • @ tym32167 the problem is that at the end I need to return the flag I need - and then it turns out to be void and I cannot thereby return the flag - MeshBenth
  • Do you understand what Timer.Once does? - tym32167

0