【问题标题】:how to read html file from azure storage explorer如何从 azure 存储资源管理器中读取 html 文件
【发布时间】:2021-09-06 07:51:57
【问题描述】:

如何从 Azure 存储资源管理器读取 .html 文件。 通过connectionstring可以访问blob。 字符串模板 = bloburl + "file.html";

【问题讨论】:

  • 斑点。字符串模板 = bloburl + "file.html";通过这个我可以访问存储资源管理器。

标签: asp.net-core azure-blob-storage azure-storage-explorer


【解决方案1】:

是的,您可以创建 html 并将其保存到创建的容器中。

您可以公开此 blob 的 URI,然后通过您的自定义 URL 访问它——您必须首先为存储容器创建一个 CNAME。

这是一个关于如何从 .NET 使用 Blob 存储的好资源: http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-blobs/

【讨论】:

    【解决方案2】:
                            var url = TemplateMain;
                            var httpClient = new HttpClient();
                            var html = await httpClient.GetStringAsync(url);
    

    我已经尝试使用 GetStringAsync 并且它工作正常。

    猜你喜欢
    • 2021-07-27
    • 2016-02-22
    • 1970-01-01
    • 1970-01-01
    • 2019-07-09
    • 2022-09-27
    • 1970-01-01
    • 2022-11-11
    • 2012-09-08
    相关资源
    最近更新 更多