Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27329

deleting files with a + sign in the name

$
0
0
hello all,

I have this simple bit of code that works fine, but if there is a plus sign ( + ) in the file name, it won't delete.

Code:

Dim fn As String = Request("fn")

        Try
            Dim strPath As String = "F:\wwwfiles\SupportDocuments\" & CID
            IO.File.Delete(Trim(strPath & "\" & fn))

        Catch ex As Exception
            Response.Write(ex.Message)
            Response.End()
        End Try

Even more annoying, there's no error.
any idea how to delete a file with plus signs in?

i'm guessing that its turning the command into IO.File.Delete(Trim(strPath & "\" & "something + something.docx"))

file name: "something + something.docx"

thanks in advance.
Dave

Viewing all articles
Browse latest Browse all 27329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>