コード例 #1
0
 public static bool IsNetworkDriveOnline(string driveRoot, int timeout)
 {
     try
     {
         string uncPath = WNet.GetRemoteUniversalName(driveRoot).UniversalName;
         return(IsSMBAvailable(uncPath, timeout));
     }
     catch
     {
         return(false);
     }
 }
コード例 #2
0
 public static bool IsNetworkDriveMapped(string driveRoot)
 {
     try
     {
         string uncPath = WNet.GetRemoteUniversalName(driveRoot).UniversalName;
         return(!String.IsNullOrEmpty(uncPath));
     }
     catch
     {
         return(false);
     }
 }