Z
Zeno Lee
I'm using File.Exists to test a file on my C: drive.
My program was strongly named and had caspol -af run on it to allow it to
run from the network.
There are 3 ways I am doing this:
1) Run from my C: drive, File.Exists works properly and says
C:\Temp\test.txt exists
2) Run from my H:\ (network) drive, File.Exists says the file doesn't exist.
3) Run from Visual Studio debugger, with project configuration property
working directory set to H:\, File.Exists works properly
What is going on? Does a strongly named exe with caspol run on it behave
differently?
Here's the code below.
[STAThread]
static void Main(string[] args)
{
string _cvs = @"C:\Temp\test.txt";
Console.WriteLine("Current Directory: " +
Directory.GetCurrentDirectory());
if (File.Exists(_cvs))
{
Console.WriteLine(_cvs + " exists.");
}
else
{
Console.WriteLine(_cvs + " doesn't exist.");
}
Console.ReadLine();
}
My program was strongly named and had caspol -af run on it to allow it to
run from the network.
There are 3 ways I am doing this:
1) Run from my C: drive, File.Exists works properly and says
C:\Temp\test.txt exists
2) Run from my H:\ (network) drive, File.Exists says the file doesn't exist.
3) Run from Visual Studio debugger, with project configuration property
working directory set to H:\, File.Exists works properly
What is going on? Does a strongly named exe with caspol run on it behave
differently?
Here's the code below.
[STAThread]
static void Main(string[] args)
{
string _cvs = @"C:\Temp\test.txt";
Console.WriteLine("Current Directory: " +
Directory.GetCurrentDirectory());
if (File.Exists(_cvs))
{
Console.WriteLine(_cvs + " exists.");
}
else
{
Console.WriteLine(_cvs + " doesn't exist.");
}
Console.ReadLine();
}