G
gary.hibbard
I've got an InfoPath form that I am developing in Visual Studio.NET.
It queries a database containing over a million filenames/locations on
a local server. I would like to be able to generate a "copy" button
for each search result that allows you to copy the file from the server
to a directory on the local machine (C:\testFolder in my example). For
now I am just trying to copy a local file to a different filename.
Here's the code I'm using for the OnClick:
string sourceFile = @"C:\\testFolder\\test1.txt";
string destinationFile = @"C:\\testFolder\\test2.txt";
System.IO.File.Copy(sourceFile, destinationFile, true);
I am getting this error message:
System.Security.SecurityException
Request for the permission of type
System.Security.Permissions.FileIOPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed
Obviously these screams "PERMISSIONS!"; however I have added everyone
to the security permissions for the "testFolder" directory and allowed
full control. Test2.txt does not exist and Test1.txt is not open.
Does anybody have any idea why? Or maybe an alternative method? The
files on the server are plain text, BTW.
Thanks,
Garyman99
It queries a database containing over a million filenames/locations on
a local server. I would like to be able to generate a "copy" button
for each search result that allows you to copy the file from the server
to a directory on the local machine (C:\testFolder in my example). For
now I am just trying to copy a local file to a different filename.
Here's the code I'm using for the OnClick:
string sourceFile = @"C:\\testFolder\\test1.txt";
string destinationFile = @"C:\\testFolder\\test2.txt";
System.IO.File.Copy(sourceFile, destinationFile, true);
I am getting this error message:
System.Security.SecurityException
Request for the permission of type
System.Security.Permissions.FileIOPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed
Obviously these screams "PERMISSIONS!"; however I have added everyone
to the security permissions for the "testFolder" directory and allowed
full control. Test2.txt does not exist and Test1.txt is not open.
Does anybody have any idea why? Or maybe an alternative method? The
files on the server are plain text, BTW.
Thanks,
Garyman99