R
Robert Munroe
I am posting this because I couldn't find anything on the subject on
Usenet. Thanks to my good friend Oliver for the tip! Tested and
works on XP Pro.
using System;
using System.Runtime.InteropServices;
namespace NetPathTest
{
class NetPath {
[DllImport("shlwapi.dll")]
public static extern bool PathIsNetworkPath(string path);
}
class Testing
{
[STAThread]
static void Main(string[] args)
{
string mydrive = @"I:\";
if (NetPath.PathIsNetworkPath( mydrive ) == true) {
Console.WriteLine( mydrive + " is a mapped drive" );
}
}
}
}
Usenet. Thanks to my good friend Oliver for the tip! Tested and
works on XP Pro.
using System;
using System.Runtime.InteropServices;
namespace NetPathTest
{
class NetPath {
[DllImport("shlwapi.dll")]
public static extern bool PathIsNetworkPath(string path);
}
class Testing
{
[STAThread]
static void Main(string[] args)
{
string mydrive = @"I:\";
if (NetPath.PathIsNetworkPath( mydrive ) == true) {
Console.WriteLine( mydrive + " is a mapped drive" );
}
}
}
}