Click here to Skip to main content
15,895,667 members
Home / Discussions / C#
   

C#

 
AnswerRe: Generics Exampe needed Pin
Gareth H3-Jun-08 4:45
Gareth H3-Jun-08 4:45 
AnswerRe: Generics Exampe needed Pin
Scott Dorman3-Jun-08 4:54
professionalScott Dorman3-Jun-08 4:54 
Questionerror while updating control from Exited event of process Pin
Xmen Real 3-Jun-08 4:15
professional Xmen Real 3-Jun-08 4:15 
AnswerRe: error while updating control from Exited event of process Pin
leppie3-Jun-08 4:29
leppie3-Jun-08 4:29 
GeneralRe: error while updating control from Exited event of process Pin
Xmen Real 3-Jun-08 5:05
professional Xmen Real 3-Jun-08 5:05 
GeneralRe: error while updating control from Exited event of process Pin
Mark Churchill3-Jun-08 17:46
Mark Churchill3-Jun-08 17:46 
GeneralRe: error while updating control from Exited event of process Pin
Xmen Real 3-Jun-08 17:49
professional Xmen Real 3-Jun-08 17:49 
QuestionSafely saving to a stream [modified] Pin
Russell Jones3-Jun-08 4:10
Russell Jones3-Jun-08 4:10 
I'm using this piece of code to dump my config settings to disk. Only problem is it seems to break on certain machines. No error gets thrown but when i try to read the file back out I get an "invalid padding" error I assume that for some reason the entire stream isn't getting written out.

Do i need to flush the stream prior to closing it? Should i save it as config.new and then overwrite the origianl veraion?

public static void EncryptToFile(string ConfigData, string FilePath)
      {
          FileStream fStream = File.Open(FilePath, FileMode.OpenOrCreate);
          Rijndael RijndaelObject = Rijndael.Create();
          ICryptoTransform encryptor = RijndaelObject.CreateEncryptor(key, IV);
          CryptoStream csEncrypt = new CryptoStream(fStream, encryptor, CryptoStreamMode.Write);
          StreamWriter sw = new StreamWriter(csEncrypt);
          sw.WriteLine(ConfigData);
          sw.Close();
          csEncrypt.Close();
          fStream.Close();
      }


Thanks for any ideas you can give me

Russell

modified on Tuesday, June 3, 2008 10:19 AM

AnswerRe: Safely saving to a stream Pin
sudhir_Kumar3-Jun-08 4:15
sudhir_Kumar3-Jun-08 4:15 
AnswerRe: Safely saving to a stream Pin
Xmen Real 3-Jun-08 4:18
professional Xmen Real 3-Jun-08 4:18 
AnswerRe: Safely saving to a stream Pin
Scott Dorman3-Jun-08 4:28
professionalScott Dorman3-Jun-08 4:28 
AnswerRe: Safely saving to a stream Pin
led mike3-Jun-08 5:02
led mike3-Jun-08 5:02 
QuestionInfragistics ultraChart Pin
NewToAspDotNet3-Jun-08 3:39
NewToAspDotNet3-Jun-08 3:39 
AnswerRe: Infragistics ultraChart Pin
Colin Angus Mackay3-Jun-08 3:42
Colin Angus Mackay3-Jun-08 3:42 
AnswerRe: Infragistics ultraChart Pin
Nouman Bhatti3-Jun-08 20:02
Nouman Bhatti3-Jun-08 20:02 
QuestionIs there a way to implement UNION declaration in C# ? Pin
cyh_cyh3-Jun-08 3:33
cyh_cyh3-Jun-08 3:33 
QuestionRe: Is there a way to implement UNION declaration in C# ? Pin
CPallini3-Jun-08 3:40
mveCPallini3-Jun-08 3:40 
AnswerRe: Is there a way to implement UNION declaration in C# ? Pin
led mike3-Jun-08 5:06
led mike3-Jun-08 5:06 
AnswerRe: Is there a way to implement UNION declaration in C# ? Pin
cyh_cyh4-Jun-08 3:23
cyh_cyh4-Jun-08 3:23 
GeneralRe: Is there a way to implement UNION declaration in C# ? Pin
CPallini4-Jun-08 3:46
mveCPallini4-Jun-08 3:46 
AnswerRe: Is there a way to implement UNION declaration in C# ? Pin
Scott Dorman3-Jun-08 4:14
professionalScott Dorman3-Jun-08 4:14 
QuestionChange mouse pointer Pin
Radu_203-Jun-08 3:22
Radu_203-Jun-08 3:22 
AnswerRe: Change mouse pointer Pin
Vasudevan Deepak Kumar8-Jun-08 20:48
Vasudevan Deepak Kumar8-Jun-08 20:48 
QuestionHow to Change PaperSize,LandScape, ... in ReportViewer ? Pin
hdv2123-Jun-08 2:51
hdv2123-Jun-08 2:51 
Questionpass data from runtime created form to main form. Pin
redspiderke3-Jun-08 2:45
redspiderke3-Jun-08 2:45 

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

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