I'm looking for a way to translate a file path on a specific PC to an absolute network path that can be used by any other computer on the same LAN. I'm fairly new to networking stuff, so forgive me if there's errors in my terminology.
When I say a file path on a specific PC, I don't mean that the file resides on that PC; the file path could reside on the PC (e.g. "C:\Foo\Bar\File.exe"), or it could be a mapped drive pointing to a folder on the same PC or another PC on the LAN. What I need to do is translate it into a form that isn't PC-specific; if I send the address to another PC on the LAN, that PC should be able to find the file. I'm not sure if I'm on the right track, but I think UNC might be the way to go.
Basically, I'm creating an application that remotely runs executables, consisting of a server (which runs on one PC) and client application (which runs on the other PCs). The user selects the file to execute on the server application using an OpenFileDialog (which can be on the same PC, or on the LAN), and it will then be converted into an absolute network path.
After determining the absolute network path, the server application will then use it to find the IP of the PC that the file resides on; if I'm correct, this could be extracted from the absolute network path. If the file is on the same PC, it will be executed; if not, a TCP or UDP connection will be made to the other PC, and the absolute network path will be sent to it.
At the other end, the client application running on the remote PC will pick up the absolute network path sent to it. It'd probably be best to check that the path points to a file on the same PC before continuing at this point. The client will then run the executable. I don't know whether I'll be able to use the absolute network path directly, or whether I'll have to convert it back into a PC-specific file path first in order to run the executable.
So long-story-short, I need to take a file path on a specific PC on a LAN and find both the name/IP of the PC that the file resides on, and an absolute network path that the PC in question can use to find the file.
Thanks!