views:

71

answers:

1

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"

So, is there a way to open a file from remote storage?

+4  A: 

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)
Chris Haas
+1 for reading the question AND comments and figuring out what he really meant, not what he said.
David Stratton
thanks worked like a charm
Nathan Koop