views:

44

answers:

1

hey from my previous question..

ive managed to finally get it all working...

if i click submit.. a file is then created in xml format but if i enter new data it will overwrite the same file how do i stop this..

this is the code i am using

Protected Sub btnWriteXML_onClick(ByVal sender As Object, ByVal e As System.EventArgs)
        Try

            Dim enc As Encoding
            Dim objXMLTW As New XmlTextWriter(Server.MapPath("contact.xml"), enc)
            objXMLTW.WriteStartDocument()
            objXMLTW.WriteStartElement("Feedback Form")

how do i stop this from overwriting?

+1  A: 

You would need to make the filename unique. Perhaps adding a timestamp or a guid or writing logic to add a sequential number onto the filename?

rchern
how do i do this :s i just about got my head around asp and xmlwhen a file is saved it saved as contact.xml...
Server.MapPath(Guid.NewGuid().ToString + ".xml") for example
Tom Cabanski