- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我想获取远程机器上“CommonApplicationData”的路径。
这是本地版本
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)
但我如何远程执行此操作?也许有一些 WMI?
最佳答案
解决了
public static string GetCommonAppData(string machineName)
{
var shellFoldersPath = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders";
using (var remoteBaseKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, machineName))
using (var shellFolders = remoteBaseKey.OpenSubKey(shellFoldersPath))
{
return (string) shellFolders.GetValue("Common AppData");
}
}
关于.net - 如何从远程机器获取 CommonApplicationData?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7356112/
我想获取远程机器上“CommonApplicationData”的路径。 这是本地版本 Environment.GetFolderPath(Environment.SpecialFolder.Comm
我正在尝试与特定系统交互,检查文件是否在特定位置,如果是,则使用存储在该文件中的 url 下载更新。 我作为示例使用的 C# 测试应用程序对话框通过使用 C# 帮助程序类解决了这个问题,该类通过将文件
我开发了 WPF 应用程序 (.NET 4.5),它在 CommonApplicationData 文件夹中存储了一些配置文件。 为此,我使用了以下内容: string AppDataFolder =
这似乎完全是随机发生的。一分钟程序还在运行,然后我做了一些更改(与程序的这一部分完全无关,我实际更改的只是项目的嵌入式资源之一),下面的属性现在只返回一个 "\"。 public static str
据我了解,您应该使用 Environment.GetFolderPath 方法,这样您就有了独立于操作系统的代码... Windows XP 使用 C:\Documents and Settings\
我需要做一些快速而肮脏的日志记录,我被要求写入一个文件。 我已完成所有日志记录,现在我需要将其保存在此 Win Server 2008 操作系统上的某个位置。 有人知道 Win Server 2008
我是一名优秀的程序员,十分优秀!