簡體   English   中英

我無法訪問文件路徑vb.net

[英]i can't access a file path vb.net

我真的不明白,代碼清晰簡潔,當我想閱讀現有文件的路徑時,我的應用程序拋出異常。

錯誤:“不支持給定路徑的格式”

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

即使我改變路徑也是一樣的問題

那是我的代碼:

    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)

這就是例外的細節

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

我猜測可能是權限問題,但我擁有所有權限,並使用Visual Studio作為Administartor

當我復制您的文本並將其粘貼到Visual Studio中,並用十六進制編輯器查看時,我在字符串中看到一些額外的字節:

在此處輸入圖片說明

刪除它,它將起作用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM