需要以编程方式编辑远程计算机上的文件

发布于 2024-12-03 18:36:02 字数 112 浏览 1 评论 0原文

我需要能够在没有包含共享文件的目录的情况下完成此操作。

我的应用程序的凭据是例如通过 RDP 登录时对该文件具有写入权限的用户的凭据,但是当尝试在代码中执行相同操作时,如何/在哪里输入这些凭据?

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

The credentials 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

铜锣湾横着走 2024-12-10 18:36:02

您可以尝试使用“隐藏”$ 共享来编辑文件。因此,如果(例如)文件位于 c:\somedir\myfile.txt 并且机器名为 mymachine,则文件的路径应为:

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

替换 C$D$ 用于 D: 驱动器等...

请注意,这些共享可能会被禁用,并且可能需要与共享所需的权限不同的权限。不过,RDP 会话值得一试。

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.

春风十里 2024-12-10 18:36:02

除非远程计算机上正在执行共享或某些服务可以为您提供数据(例如FTP),否则该文件根本无法从外部访问。

有提到的隐藏共享,这非常值得您在紧要关头尝试,尽管这并不能特别解决如何访问文件的确切问题“没有包含共享文件的目录 ”。

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".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文