Click here to Skip to main content
11,494,407 members (62,092 online)

Visual Basic

 
GeneralRe: Changing Assembly Properties through Reflection Pin
Eddy Vluggen16-Nov-12 1:06
memberEddy Vluggen16-Nov-12 1:06 
Questionmessagebeep Pin
Gil Goodridge14-Nov-12 9:00
memberGil Goodridge14-Nov-12 9:00 
AnswerRe: messagebeep Pin
Dave Kreskowiak14-Nov-12 9:31
mvpDave Kreskowiak14-Nov-12 9:31 
QuestionRijndael encryption not working Pin
maskrtnik0114-Nov-12 3:20
membermaskrtnik0114-Nov-12 3:20 
AnswerRe: Rijndael encryption not working Pin
Keith Barrow14-Nov-12 3:52
mentorKeith Barrow14-Nov-12 3:52 
GeneralRe: Rijndael encryption not working Pin
maskrtnik0114-Nov-12 4:08
membermaskrtnik0114-Nov-12 4:08 
GeneralRe: Rijndael encryption not working Pin
Keith Barrow14-Nov-12 4:26
mentorKeith Barrow14-Nov-12 4:26 
GeneralRe: Rijndael encryption not working Pin
Keith Barrow14-Nov-12 4:35
mentorKeith Barrow14-Nov-12 4: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 Pin
maskrtnik0114-Nov-12 4:48
membermaskrtnik0114-Nov-12 4:48 
GeneralRe: Rijndael encryption not working Pin
Keith Barrow14-Nov-12 5:05
mentorKeith Barrow14-Nov-12 5:05 
QuestionRe: Rijndael encryption not working [modified] Pin
maskrtnik0115-Nov-12 20:40
membermaskrtnik0115-Nov-12 20:40 
GeneralRe: Rijndael encryption not working Pin
DisIsHoody14-Nov-12 10:34
memberDisIsHoody14-Nov-12 10:34 
GeneralRe: Rijndael encryption not working Pin
maskrtnik0114-Nov-12 19:21
membermaskrtnik0114-Nov-12 19:21 
AnswerRe: Rijndael encryption not working Pin
DisIsHoody15-Nov-12 18:37
memberDisIsHoody15-Nov-12 18:37 
GeneralRe: Rijndael encryption not working Pin
maskrtnik0115-Nov-12 20:37
membermaskrtnik0115-Nov-12 20:37 
QuestionRetrive date from sql server in system date format in VB6 application by a one time setting Pin
Johnson Antony13-Nov-12 14:34
memberJohnson Antony13-Nov-12 14:34 
AnswerRe: Retrive date from sql server in system date format in VB6 application by a one time setting Pin
Dave Kreskowiak13-Nov-12 15:00
mvpDave Kreskowiak13-Nov-12 15:00 
QuestionHow to find out if a file is in use before reading the data in that file Pin
KreativeKai13-Nov-12 8:47
memberKreativeKai13-Nov-12 8:47 
AnswerRe: How to find out if a file is in use before reading the data in that file Pin
Dave Kreskowiak13-Nov-12 9:09
mvpDave Kreskowiak13-Nov-12 9:09 
GeneralRe: How to find out if a file is in use before reading the data in that file Pin
KreativeKai13-Nov-12 9:22
memberKreativeKai13-Nov-12 9:22 
GeneralRe: How to find out if a file is in use before reading the data in that file Pin
KreativeKai13-Nov-12 9:46
memberKreativeKai13-Nov-12 9:46 
AnswerRe: How to find out if a file is in use before reading the data in that file Pin
KreativeKai13-Nov-12 9:13
memberKreativeKai13-Nov-12 9:13 
GeneralRe: How to find out if a file is in use before reading the data in that file [modified] Pin
Dave Kreskowiak13-Nov-12 10:57
mvpDave Kreskowiak13-Nov-12 10:57 
AnswerRe: How to find out if a file is in use before reading the data in that file Pin
Eddy Vluggen13-Nov-12 12:41
memberEddy Vluggen13-Nov-12 12:41 
GeneralRe: How to find out if a file is in use before reading the data in that file Pin
KreativeKai14-Nov-12 2:37
memberKreativeKai14-Nov-12 2:37 

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.150520.1 | Last Updated 29 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid