Open a file from a remote network share
I am trying to open a file from a server
I currently have
Dim attachedFilePath As String = "\\myserver\myshare\test.txt"
File.Open(attachedFilePath, FileMode.Open, FileAccess.Read, FileShare.Read)
This does not open a file.
However, if I change the path to be local then there is no issue.
Dim attachedFilePath As String = "c:\...\test.txt"
开发者_如何学C
So, is there a way to open a file from remote storage?
File.Open is for reading the contents of a file. Use Process.Start to launch the default application for that file type
Dim Path = "\\myserver\myshare\test.txt"
System.Diagnostics.Process.Start(Path)
精彩评论