c# - 如何使用 Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) 连接到外部服务器
问题描述
以下代码是我试图用来连接到外部服务器并进入 AppData 文件夹中的子目录的代码。
string targetPath = @"\\externalServer\" + Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Litera\\Customize";
在单步执行程序时,它来到第 16 行,但无法说明“不支持给定路径的格式”。但是,destFile 显示“\\externalServer\C:\Users\username\AppData\Roaming\Litera\Customize\Customize.xml”。对我来说,该程序正在找到我想要的路径。有人可以帮我解决这个问题吗?
File.Copy(sourceFile, destFile, true);
解决方案
推荐阅读
- javascript - 在动态添加的 DOM 元素上使用点击事件
- mysql - 对于某些旧版本的 MySQL,`<> ##` 是否曾经匹配过`NULL`
- sql - 如何根据输入的单词执行 SQL 搜索?
- jquery - 如何使用 $().find() 循环 jQuery 解析超过 2
- python-3.x - Pandas DataFrame:我们如何根据索引名称保留列?
- c# - 如何使用 WWW 将本地文件加载为 AssetBundle
- javascript - Promises.all() 打破顺序链接
- java - 数组列表上的不兼容类型错误,无法分配
- visual-studio-2017 - Visual Studio 2017 平台工具集问题
- python - 绘制给定函数定义的图形