我正在使用一个XmlDocument对象。当我将 xml 文件保存到 Azure blob 存储时,它是成功的。但是当我尝试从 Azure 下载它时,内容只显示“ System.Xml.XmlDocument.”。我究竟做错了什么?
这是我的代码:
XmlDocument doc = new XmlDocument();
// ...content of doc omitted for brevity
using (Stream stream = new MemoryStream(Encoding.UTF8.GetBytes(doc.ToString())))
{
try
{
log.Info("Attempting to save file " + filename + " to: " + containerName);
blob.UploadFromStream(stream);
}
catch (Exception ex)
{
log.Error("Error uploading file. " + ex.Message + " " + ex.InnerException);
};
}
紫衣仙女
相关分类