I am trying to build file manager tools for window PC, I already build tools for drives (c:, d:, e: ..) where I can delete, edit files and folders.
My problem is, I am trying to do the same thing (edit, delete) for shared files and folders. This files and folders are already shared in the private network where we can use "Network" to manipulate files and folder manually (image). I already did copy, delete, rename of files and folder using System.IO. But I cannot able to list those UNC name and search directory, files.
Fig. Pic of my "Network" shared & also in this pic "DESKTOP-xxx" is other PC and other one is local PC.
Question:
- Is there any library/example code that can do List Devices/Machine Name?
- Is there any library/example code that can search or directory/file list in specific path?
If I get the path I can easily manipulate the file using System.IO.
What have I done?
- I already used some Powershell command to list shared devices no luck.
- net view (this show "System error 6118 has occurred")
- Get-SMBShare (this shows my shared files/folder)
- Get-SmbMapping (this shows some disconnected machine UNC paths)
- Followed this guide too:
- https://www.codeproject.com/Articles/16113/Retreiving-a-list-of-network-computer-names-using (basically; this is not working)
- https://www.codeproject.com/Articles/2939/Network-Shares-and-UNC-paths (too old; not working)
- https://bytes.com/topic/c-sharp/answers/445786-how-get-list-all-shared-folders (I used this, it only shows current shared folders, I want other pc shared folders like described in above)
- Also I am looking into ManagementClass("Win32_Share"), I didn't find many example.
If somebody knows how to list and manipulate shared files programmatically which is available in the network please share any information. Anything would be great help.
Thank you in advance.