Xamarin.Android: 访问路径 ******** 被拒绝

Xamarin.Android: Access to the path ******** is denied

尝试通过调用 Web 服务方法使用我的 Xamarin 应用程序打印文件时出现上述错误。当从浏览器调用相同的方法时,它可以毫无问题地打印出来。授予外部存储的写入和读取权限。我要打印的文件位于共享网络文件夹中。仅应用程序拒绝文件夹访问的原因可能是什么?

那是使用 filepath 的代码部分:

public static string SubstituteFileContent(string filePath, string substituteValues)
        {
            var rdr = new StreamReader(filePath);
            var fileContent = rdr.ReadToEnd();
            //textBoxSource.Text = fileContent;
            var index = fileContent.IndexOf("^XA");
            fileContent = fileContent.Remove(0, index);
            var start = fileContent.IndexOf("^DFE");
            var end = fileContent.IndexOf(".ZPL^");
            fileContent = fileContent.Remove(start, end - start + 4);

            rdr.Close();

            var substitutedContent = SubstituteFields(fileContent, substituteValues);
            return substitutedContent;
        }

好的,自己解决了。我必须在共享设置下明确地与 "Everyone" 共享网络文件夹。