开发者

Need to programatically edit a file on remote machine

I need to be able to do it without the directory containing the file being shared .

The cre开发者_运维百科dentials of my application are of a user who has write permissions on that file when logging in via RDP for instance, but how/where can I input these credentials when trying to do the same in code?


You could try editing the file using the "hidden" $ shares. So if (for example) the file is located at c:\somedir\myfile.txt and the machine is called mymachine the path to the file should be:

\\mymachine\C$\somedir\myfile.txt

Replace C$ with D$ for the D: drive etc...

Note that these shares may be disabled and may require different permissions from those needed for a RDP session, howevers its worth a try.


Unless there's a share or some service that is executing on the remote machine that can serve you the data (e.g. FTP) then that file is simply not going to be externally accessible.

There are the hidden shares as mentioned, which is well worth you trying in a pinch, though that doesn't particular solve the exact problem of how to access a file "without the directory containing the file being shared".

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜