Click here to Skip to main content
       

Visual Basic

 
GeneralRe: Finding a Row in a Datatable and putting the row to variables PinmemberJRHibner27-Nov-12 23:40 
GeneralRe: Finding a Row in a Datatable and putting the row to variables PinmemberAndy_L_J28-Nov-12 0:20 
GeneralRe: Finding a Row in a Datatable and putting the row to variables PinmemberJRHibner28-Nov-12 10:35 
QuestionChanging Assembly Properties through Reflection PinmemberDisIsHoody14-Nov-12 9:38 
AnswerRe: Changing Assembly Properties through Reflection PinmemberEddy Vluggen15-Nov-12 1:18 
GeneralRe: Changing Assembly Properties through Reflection PinmemberDisIsHoody15-Nov-12 17:14 
GeneralRe: Changing Assembly Properties through Reflection PinmemberEddy Vluggen16-Nov-12 0:06 
Questionmessagebeep PinmemberGil Goodridge14-Nov-12 8:00 
AnswerRe: messagebeep PinmvpDave Kreskowiak14-Nov-12 8:31 
QuestionRijndael encryption not working Pinmembermaskrtnik0114-Nov-12 2:20 
AnswerRe: Rijndael encryption not working PinmentorKeith Barrow14-Nov-12 2:52 
GeneralRe: Rijndael encryption not working Pinmembermaskrtnik0114-Nov-12 3:08 
GeneralRe: Rijndael encryption not working PinmentorKeith Barrow14-Nov-12 3:26 
GeneralRe: Rijndael encryption not working PinmentorKeith Barrow14-Nov-12 3:35 
I think I may have figured it out!
 

The cryptostream writes to a filestream. The XML can't write to the same stream, and if you use a different stream you'll either overwrite (this is probably your situation) or it'll append the XML after the encrypted information. The other option is the XML is written first, then appended or overwitten with the encrypted information, neith seems to apply in your case.
 
In your position I'd replace the file stream with a memory stream for the cryptography stuff. I'd perform the write immediately, reset the position to 0 and pass the memory stream into the Export method. Then all the XML writer has to do is to read the Memory stream into the file stream when you've reached the correct point in the file (or set a property to its contents).
 
The other problem you might face is that you need to encode the encrypted bytes (e.g. into Hex characters), otherwise you'll get non-printing characters in the XML document, fouling it up.

GeneralRe: Rijndael encryption not working Pinmembermaskrtnik0114-Nov-12 3:48 
GeneralRe: Rijndael encryption not working PinmentorKeith Barrow14-Nov-12 4:05 
QuestionRe: Rijndael encryption not working [modified] Pinmembermaskrtnik0115-Nov-12 19:40 
GeneralRe: Rijndael encryption not working PinmemberDisIsHoody14-Nov-12 9:34 
GeneralRe: Rijndael encryption not working Pinmembermaskrtnik0114-Nov-12 18:21 
AnswerRe: Rijndael encryption not working PinmemberDisIsHoody15-Nov-12 17:37 
GeneralRe: Rijndael encryption not working Pinmembermaskrtnik0115-Nov-12 19:37 
QuestionRetrive date from sql server in system date format in VB6 application by a one time setting PinmemberJohnson Antony13-Nov-12 13:34 
AnswerRe: Retrive date from sql server in system date format in VB6 application by a one time setting PinmvpDave Kreskowiak13-Nov-12 14:00 
QuestionHow to find out if a file is in use before reading the data in that file PinmemberKreativeKai13-Nov-12 7:47 
AnswerRe: How to find out if a file is in use before reading the data in that file PinmvpDave Kreskowiak13-Nov-12 8:09 
GeneralRe: How to find out if a file is in use before reading the data in that file PinmemberKreativeKai13-Nov-12 8:22 
GeneralRe: How to find out if a file is in use before reading the data in that file PinmemberKreativeKai13-Nov-12 8:46 
AnswerRe: How to find out if a file is in use before reading the data in that file PinmemberKreativeKai13-Nov-12 8:13 
GeneralRe: How to find out if a file is in use before reading the data in that file [modified] PinmvpDave Kreskowiak13-Nov-12 9:57 
AnswerRe: How to find out if a file is in use before reading the data in that file PinmemberEddy Vluggen13-Nov-12 11:41 
GeneralRe: How to find out if a file is in use before reading the data in that file PinmemberKreativeKai14-Nov-12 1:37 
GeneralRe: How to find out if a file is in use before reading the data in that file [modified] PinmemberVitorHugoGarcia19-Nov-12 1:12 
QuestionVB Script for automatically turning off the monitor PinmemberPrasan Cumar13-Nov-12 4:14 
AnswerRe: VB Script for automatically turning off the monitor PinmvpDave Kreskowiak13-Nov-12 4:59 
AnswerRe: VB Script for automatically turning off the monitor PinmemberBernhard Hiller13-Nov-12 21:20 
QuestionSQL Configuration PinmemberDinoRondelly13-Nov-12 3:46 
AnswerRe: SQL Configuration PinmemberDavid Mujica13-Nov-12 4:07 
GeneralRe: SQL Configuration PinmemberDinoRondelly13-Nov-12 5:56 
GeneralRe: SQL Configuration PinmemberDavid Mujica13-Nov-12 9:44 
GeneralRe: SQL Configuration PinmemberDinoRondelly13-Nov-12 18:17 
QuestionSource Code PinmemberMember 939009712-Nov-12 15:59 
AnswerRe: Source Code PinmvpDave Kreskowiak13-Nov-12 2:20 
QuestionMonitoring Network Usage For Remote Users [modified] PinmemberDinoRondelly12-Nov-12 10:54 
AnswerRe: Monitoring Network Usage For Remote Users PinmemberEddy Vluggen13-Nov-12 11:44 
QuestionScan Multipage Tiff Image For A Barcode Pinmemberdaveofgv12-Nov-12 4:07 
AnswerRe: Scan Multipage Tiff Image For A Barcode PinmemberEddy Vluggen12-Nov-12 10:54 
QuestionGetting All Logged On Users and IP VB.net PinmemberDinoRondelly12-Nov-12 3:39 
AnswerRe: Getting All Logged On Users and IP VB.net PinmvpDave Kreskowiak12-Nov-12 4:37 
GeneralRe: Getting All Logged On Users and IP VB.net PinmemberDinoRondelly12-Nov-12 4:44 
GeneralRe: Getting All Logged On Users and IP VB.net PinmvpDave Kreskowiak12-Nov-12 4:52 

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.140921.1 | Last Updated 22 Sep 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid