I'm just trying to do a simple encrypt of a file. I'm getting a System.IO.IOException thrown when the method executes. Am I mis-interpreting this method The documentation states that it's available in C#. Here's a snippet of the important parts.
using System;
using System.IO;
using System.Security.AccessControl;
try
{
File.Encrypt("G:\\test.tx1"); //this is an NTFS partition}
catch (IOException er){
MessageBox.Show(er.ToString(), "error", MessageBoxButtons.OK);}
The error is System.IO.IOException: The request is not supported. Then points back to the line containing the File.Encrypt statement above.

File.encrypt method
Display Name*
Wytze
Is G: a network drive
Sameer S
Budoray
Alternatively check is the file is not locked by some other process and it has Read/Write ability i.e. it is not marked as read-only.
Regards,
Saurabh Nandu
www.MasterCSharp.com
www.AksTech.com
unknwn
I was looking at the Encrypt method's IL and it raises the request is not supported error in case your program does not have permissions or you drive is not NTFS.
Regards,
Saurabh Nandu
www.MasterCSharp.com
www.AksTech.com
Kazuya Ujihara
Bartjes
papst13
Here's the exception thrown.
System.IO.IOException: The request is not supported.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.Encrypt(String path)
at encryptFile.Form1.Encrypt_Click(Object sender, EventArgs e) in G:\....cs:line 41