简体   繁体   中英

i can't access a file path vb.net

i really don't understand , the code is clear and simple , my app throw exception when i want to read the path of an existing file .

the error : "the given path's format is not supported"

https://i.stack.imgur.com/rXNTN.png

even if i changed the path it's the same problem

that's my code :

    Dim testFile As System.IO.FileInfo
    testFile = My.Computer.FileSystem.GetFileInfo("‪C:\Users\ochallal\Desktop\ENQ1620_3.sdf")
    Dim folderPath As String = testFile.DirectoryName
    Dim fileName As String = testFile.Name
    Dim fullPath As String
    fullPath = My.Computer.FileSystem.CombinePath(folderPath, fileName)

and that's the details of the exception

https://i.stack.imgur.com/njJcv.png

i'm guessing that it could be permission stuff but i have all permissions and using visual studio as Administartor

When I copy your text and paste it in Visual Studio, and look with a hex editor at it I see some extra bytes in the string:

在此处输入图片说明

Remove that and it will work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM