Note that there are some explanatory texts on larger screens.

plurals
  1. POAccess to path is denied C:\Users\SkyDrive\SSD\SSDAssignment\SSDAssignment\MvcApplication1\Gallery
    primarykey
    data
    text
    <p>Im trying to access the DestinationFileName but it gives me an exception that the acces to path is denied. Know the data that i usually pass in the Path variable is C:\Users\SkyDrive\SSD\SSDAssignment\SSDAssignment\MvcApplication1\Gallery\abc.jpg and the path in the DestinationFileName is C:\Users\SkyDrive\SSD\SSDAssignment\SSDAssignment\MvcApplication1\Gallery</p> <pre><code> FileStream InFile = new FileStream(Path, FileMode.Open); FileStream OutputStream = new FileStream(DestinationFileName, FileMode.Create, FileAccess.ReadWrite); </code></pre> <p>Anyone has any idea why i am having this exception pls..</p> <p>his is the whole method so that it will be more clear</p> <pre><code>public bool HybridEncription(string Path, string DestinationFileName, string PublicKey) { FileStream InFile = new FileStream(Path, FileMode.Open); FileStream OutputStream = new FileStream(DestinationFileName, FileMode.Create, FileAccess.ReadWrite); RijndaelManaged Rm = null; byte[] ToEncBytes = null; try { ToEncBytes = new byte[InFile.Length]; InFile.Read(ToEncBytes, 0, (int)InFile.Length); //Ask to use Keys of digital signing RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(); rsa.FromXmlString(PublicKey); Rm = new RijndaelManaged(); byte[] EncryptedKey = rsa.Encrypt(Rm.Key, false); byte[] EncryptedIV = rsa.Encrypt(Rm.IV, false); OutputStream.Write(EncryptedKey, 0, EncryptedKey.Length); OutputStream.Write(EncryptedIV, 0, EncryptedIV.Length); ICryptoTransform Transform = Rm.CreateEncryptor(); CryptoStream CStream = new CryptoStream(OutputStream, Transform, CryptoStreamMode.Write); CStream.Write(ToEncBytes, 0, ToEncBytes.Length); CStream.FlushFinalBlock(); OutputStream.Flush(); CStream.Close(); InFile.Close(); OutputStream.Close(); System.IO.File.Delete(Path); return true; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload