Click here to Skip to main content
15,886,362 members
Home / Discussions / C#
   

C#

 
GeneralRe: Delegates and Parallel.For Pin
S. Senthil Kumar25-May-09 3:52
S. Senthil Kumar25-May-09 3:52 
GeneralRe: Delegates and Parallel.For Pin
Fahad Sadah25-May-09 7:26
Fahad Sadah25-May-09 7:26 
AnswerRe: Delegates and Parallel.For Pin
Nicholas Butler25-May-09 7:54
sitebuilderNicholas Butler25-May-09 7:54 
QuestionSlide bar Pin
yesu prakash25-May-09 1:18
yesu prakash25-May-09 1:18 
AnswerRe: Slide bar Pin
Eduard Keilholz25-May-09 3:37
Eduard Keilholz25-May-09 3:37 
QuestionAccessing the right Registry entry for Internet Explorer in C# Pin
ramz_g25-May-09 1:05
ramz_g25-May-09 1:05 
AnswerRe: Accessing the right Registry entry for Internet Explorer in C# Pin
Rajesh R Subramanian25-May-09 4:03
professionalRajesh R Subramanian25-May-09 4:03 
QuestionXmlTextWriter and MemoryStream Pin
OriginalGriff25-May-09 1:05
mveOriginalGriff25-May-09 1:05 
Is there any way to get a XmlTextWriter to work with a MemoryStream, so that it doesn't close it when it is finished?
What I'm trying to do is:
List<T> -> MemoryStream (as XML) -> TripleDES encyrption -> file.
And later:
file -> TripleDES decryption -> MemoryStream -> List<T>

And since XmlTextWriter always closes the stream when it completes, the MemoryStream is useless!
Yes, XMLTextWriter has settings, but they are null or read-only, so you can't set "CloseOutput = false"

(No, I don't want to use XMLSerialiser, for very dull reasons!)

I have got round it by moving to XmlWriter and using the settings that way, but this was such a waste of time!

Old way:
WriteXML(listCards, new XmlTextWriter(stream, Encoding.UTF8));
if (stream.CanSeek)
    {
    stream.Seek(0, 0);
    }

New way:
XmlWriterSettings settings = new XmlWriterSettings();
settings.OmitXmlDeclaration = false;
settings.ConformanceLevel = ConformanceLevel.Document;
settings.CloseOutput = false;
settings.Indent = true;
settings.Encoding = Encoding.UTF8;
WriteXML(listCards, XmlWriter.Create(stream, settings));
if (stream.CanSeek)
    {
    stream.Seek(0, 0);
    }


No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.

This message is made of fully recyclable Zeros and Ones

Question7.1 Surround Sound Pin
Chris MacEwan25-May-09 0:51
Chris MacEwan25-May-09 0:51 
AnswerRe: 7.1 Surround Sound Pin
molesworth25-May-09 2:18
molesworth25-May-09 2:18 
Questionopen aspx page Pin
michaelgr125-May-09 0:50
michaelgr125-May-09 0:50 
AnswerRe: open aspx page Pin
padmanabhan N25-May-09 1:31
padmanabhan N25-May-09 1:31 
GeneralRe: open aspx page Pin
michaelgr125-May-09 1:32
michaelgr125-May-09 1:32 
AnswerRe: open aspx page Pin
Ramesh Swaminathan25-May-09 3:22
Ramesh Swaminathan25-May-09 3:22 
AnswerRe: open aspx page Pin
Vasudevan Deepak Kumar25-May-09 3:51
Vasudevan Deepak Kumar25-May-09 3:51 
QuestionWrong COM Port Number Pin
stancrm25-May-09 0:04
stancrm25-May-09 0:04 
AnswerRe: Wrong COM Port Number Pin
Moreno Airoldi25-May-09 3:56
Moreno Airoldi25-May-09 3:56 
GeneralRe: Wrong COM Port Number Pin
Rajesh Anuhya25-May-09 3:58
professionalRajesh Anuhya25-May-09 3:58 
GeneralRe: Wrong COM Port Number Pin
Dave Kreskowiak25-May-09 6:59
mveDave Kreskowiak25-May-09 6:59 
AnswerRe: Wrong COM Port Number Pin
Rajesh Anuhya25-May-09 3:56
professionalRajesh Anuhya25-May-09 3:56 
QuestionHow will I pass argument to Process Pin
Naveed72724-May-09 22:07
Naveed72724-May-09 22:07 
AnswerRe: How will I pass argument to Process Pin
S. Senthil Kumar24-May-09 22:38
S. Senthil Kumar24-May-09 22:38 
AnswerRe: How will I pass argument to Process Pin
Luc Pattyn24-May-09 23:56
sitebuilderLuc Pattyn24-May-09 23:56 
QuestionHow can I know the Internet Explorer Information using c#? Pin
svt gdwl24-May-09 21:23
svt gdwl24-May-09 21:23 
AnswerRe: How can I know the Internet Explorer Information using c#? Pin
Manas Bhardwaj24-May-09 23:17
professionalManas Bhardwaj24-May-09 23:17 

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.