开发者

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)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜