开发者

stop overwriting an xml file

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜