Click here to Skip to main content
       

C#

 
AnswerRe: Latency In Button Click When Using MVVM PinmemberSledgeHammer0111-Jan-13 9:38 
GeneralRe: Latency In Button Click When Using MVVM PinmemberTee12311-Jan-13 10:14 
QuestionC# computer name rename PinmemberEvetsMostel11-Jan-13 7:00 
AnswerRe: C# computer name rename Pinmemberjibesh11-Jan-13 7:47 
GeneralRe: C# computer name rename [modified] PinmemberEvetsMostel11-Jan-13 7:54 
GeneralRe: C# computer name rename PinmemberEvetsMostel11-Jan-13 11:30 
GeneralRe: C# computer name rename PinmemberEvetsMostel14-Jan-13 13:15 
QuestionFTP Decryption Error PinmemberMember 865395910-Jan-13 18:22 
I'm developing ftp application in c# winform framework 3.5 visual studio 2008.
algorithm im using for encryption is "RijndaelManaged" but in decryption getting error.
i scheduling time it automatically uploads all files from specific directory(client system) to FTP server, pls suggests me which algorithm is used for ftp in c#...
 
here is my code.
 
public static void EncryptFile(string inputFile, string outputFile, string skey)
      {
          RijndaelManaged aes = new RijndaelManaged();
          try
          {
              byte[] key = ASCIIEncoding.UTF8.GetBytes(skey);
 
              using (FileStream fsCrypt = new FileStream(outputFile, FileMode.Create))
              {
                  using (CryptoStream cs = new CryptoStream(fsCrypt, aes.CreateEncryptor(key, key), CryptoStreamMode.Write))
                  {
                      using (FileStream fsIn = new FileStream(inputFile, FileMode.Open))
                      {
                          int data;
 
                          while ((data = fsIn.ReadByte()) != -1)
                          {
                              cs.WriteByte((byte)data);
                          }
 
                          aes.Clear();
                      }
                  }
              }
          }
          catch (Exception ex)
          {
              Console.WriteLine(ex.Message);
              aes.Clear();
          }
      }
 
private static void DecryptFile(string inputFile, string outputFile, string skey)
        {
            RijndaelManaged aes = new RijndaelManaged();
 
            try
            {
                byte[] key = ASCIIEncoding.UTF8.GetBytes(skey);
 
                using (FileStream fsCrypt = new FileStream(inputFile, FileMode.Open))
                {
                    using (FileStream fsOut = new FileStream(outputFile, FileMode.Create))
                    {
                        using (CryptoStream cs = new CryptoStream(fsCrypt, aes.CreateDecryptor(key, key), CryptoStreamMode.Read))
                        {
                            int data;
 
                            while ((data = cs.ReadByte()) != -1)
                            {
                                fsOut.WriteByte((byte)data);
                            }
 
                            aes.Clear();
                        }
                    }
                }
 
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                aes.Clear();
            }
        }

AnswerRe: FTP Decryption Error PinmemberBernhard Hiller10-Jan-13 21:46 
GeneralRe: FTP Decryption Error PinmemberGarth J Lancaster11-Jan-13 11:00 
AnswerRe: FTP Decryption Error PinmvpEddy Vluggen11-Jan-13 2:28 
GeneralRe: FTP Decryption Error PinmemberGarth J Lancaster11-Jan-13 11:00 
Questionhow to export a div to pdf Pinmembershineskollam10-Jan-13 18:17 
AnswerRe: how to export a div to pdf PinmvpRichard MacCutchan10-Jan-13 21:51 
QuestionRegarding implementation of Dependency Injection with C# PinmemberTridip Bhattacharjee10-Jan-13 2:06 
AnswerRe: Regarding implementation of Dependency Injection with C# PinprotectorPete O'Hanlon10-Jan-13 2:22 
AnswerRe: Regarding implementation of Dependency Injection with C# Pinmemberjschell10-Jan-13 14:03 
AnswerRe: Regarding implementation of Dependency Injection with C# PinmemberSledgeHammer0110-Jan-13 14:57 
GeneralRe: Regarding implementation of Dependency Injection with C# PinmemberTridip Bhattacharjee10-Jan-13 20:07 
GeneralRe: Regarding implementation of Dependency Injection with C# PinprotectorPete O'Hanlon10-Jan-13 21:11 
QuestionHow to draw an arc in winRT with animation? Pinmemberabinashokk9-Jan-13 21:55 
AnswerRe: How to draw an arc in winRT with animation? PinprotectorPete O'Hanlon9-Jan-13 22:34 
QuestionC#.NET 3.5 Code review checklist PinmemberMember 31370789-Jan-13 20:28 
AnswerRe: C#.NET 3.5 Code review checklist PinmvpEddy Vluggen9-Jan-13 22:54 
AnswerRe: C#.NET 3.5 Code review checklist Pinmemberdeflinek10-Jan-13 0:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 26 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid