|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Data Access AdviceI need to post xml data to a url, I have have created an xml file using an xml text writer as below but would rather a faster method that does not involve writing the file to disk but using it from memory instead. Could anyone suggest a method that is similar in coding (so as not to require too many code changes). Dim writer As New System.Xml.XmlTextWriter("c:\temp\TestXml.xml", System.Text.Encoding.UTF8) ..Formatting = Xml.Formatting.Indented ..Indentation = 1 ..IndentChar = ControlChars.Tab ..WriteStartDocument() ..WriteStartElement("........ Thanks B
Show quote
Hide quote
"Ben" <B**@Newsgroups.microsoft.com> wrote in message
news:ucYl1Yb4GHA.696@TK2MSFTNGP06.phx.gbl... > Hi > > I need to post xml data to a url, I have have created an xml file using an > xml text writer as below but would rather a faster method that does not > involve writing the file to disk but using it from memory instead. Could > anyone suggest a method that is similar in coding (so as not to require > too many code changes). > > Dim writer As New System.Xml.XmlTextWriter("c:\temp\TestXml.xml", > System.Text.Encoding.UTF8) > > .Formatting = Xml.Formatting.Indented > > .Indentation = 1 > > .IndentChar = ControlChars.Tab > > .WriteStartDocument() > > .WriteStartElement("........ > > Thanks > B > Instead of backing your XmlTextWriter with a disk file, back it with some
form of Stream object. I tend to use a StringWriter. """ONE""" way of using it could be: Dim _sw As New StringWriter Dim writer As New System.Xml.XmlTextWriter(_sw, System.Text.Encoding.UTF8) ... Do your stuff here _sw.Close ... Post the result of _sw.ToString to the url. Show quoteHide quote "Ben" <B**@Newsgroups.microsoft.com> wrote in message news:ucYl1Yb4GHA.696@TK2MSFTNGP06.phx.gbl... > Hi > > I need to post xml data to a url, I have have created an xml file using an > xml text writer as below but would rather a faster method that does not > involve writing the file to disk but using it from memory instead. Could > anyone suggest a method that is similar in coding (so as not to require > too many code changes). > > Dim writer As New System.Xml.XmlTextWriter("c:\temp\TestXml.xml", > System.Text.Encoding.UTF8) > > .Formatting = Xml.Formatting.Indented > > .Indentation = 1 > > .IndentChar = ControlChars.Tab > > .WriteStartDocument() > > .WriteStartElement("........ > > Thanks > B >
check username and password in database
A question of design How to make stacktrace include linenumber for release compiles? REPLACE method: unwanted multiple-replacement Detect right-click in MDI container's client area? word length occurance in a text.. Encrypt a date to use in demo version System.Diagnostics.Process.Start Freezes No Recursive instr?!! RTf to Word.Doc |
|||||||||||||||||||||||