.net - Cancel a .C# Net BackgroundWorker blocked on I/O operation -
i'm required use framework 3.5. want test whether file on computer named bob exists. i'm using backgroundworker , file.exists(filename). if bob offline call block tens of seconds. abort() , interrupt() have no effect while worker waiting call file.exists() return. i'd interrupt file.exists() immediately. can suggest way doesn't involve p/invoke? thanks. to clarify, need periodically check see whether file available. can't know whether remote computer configured respond pings. i'm running standard user, not admin. have no access remote system administrators. it looks framework 4.0 or 4.5 has async capability i'm restricted 3.5. editing add test program: // first call file.exists waits @ least 20 seconds first time // remote computer taken off line. demonstrate, set testfile name // of file on remote computer , start program. disable // remote computer's network connection. each time disable test // program pauses. in test local computer run