开发者

stop overwriting an xml file

开发者 https://www.devze.com 2022-12-28 04:08 出处:网络
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

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 开发者_Go百科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?


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消