Schlagwort: warten auf laufwerk

  • Warten bis Laufwerk bereit async responsive UI

    von

    in

    Aus irgend einem Grund hatte ich schon relativ oft das Problem, dass ich in einer Anwendung auf ein Laufwerk (Netzlaufwerk/Festplatte/Usb Stick) warten musste. So habe ich es früher gemacht (GUI wird unbedienbar und hängt) //short form without async await (annoying!) private void WaitForDrive(string path) { try { while (!Directory.Exists(path)) { Thread.Sleep(1500); } } catch (Exception)…