Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3699766
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:08:34+00:00 2026-05-19T05:08:34+00:00

i created a windows service that move files around between the server’s hard drive

  • 0

i created a windows service that move files around between the server’s hard drive (where the service is installed) to the network drive mapped in the server. one of the problems I encountered while creating a solution was network problems.

how do i check if a network drive exists while setting a timeout in checking it? If it times out, I catch the exception and retry in X number of minutes and leave items in queue.

thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T05:08:35+00:00Added an answer on May 19, 2026 at 5:08 am

    Put the call in a seperate thread and close the thread after a certain timeout. The following link implements a timeout logic for a method:

    http://kossovsky.net/index.php/2009/07/csharp-how-to-limit-method-execution-time/

    EDIT

    One of the comments on the topic above suggest a better implementation using .NET Async Pattern:

    public static T SafeLimex<T>(Func<T> F, int Timeout, out bool Completed)   
       {
           var iar = F.BeginInvoke(null, new object());
           if (iar.AsyncWaitHandle.WaitOne(Timeout))
           {
               Completed = true;
               return F.EndInvoke(iar);
           }
             F.EndInvoke(iar);
             Completed = false;
           return default(T);
       } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have already created a windows service that monitors the network for some specific
I've created a Windows Service that uses WCF for communications to it. The service
I have created a simple windows service that periodically checks a remote database via
We have created a WCF service hosted in a windows service that handles Authentication
The problem i'm having is that i've created a web service, and a windows
I've created a Windows Service that accepts commands from remote machines via WCF. One
How do I create an installer for a Windows Service that I have created
I created a .NET windows service that installs without any issues on the dev
I created windows service using csharp in that i am accessing shared folders which
I've created a windows service that runs locally and provides a web service which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.