简体   繁体   English

我无法访问文件路径vb.net

[英]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 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 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 我猜测可能是权限问题,但我拥有所有权限,并使用Visual Studio作为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: 当我复制您的文本并将其粘贴到Visual Studio中,并用十六进制编辑器查看时,我在字符串中看到一些额外的字节:

在此处输入图片说明

Remove that and it will work. 删除它,它将起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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