System.Xml.XmlDocument亚马逊s3相当于.net

时间:2015-10-06 06:58:33

标签: c# .net amazon-s3

我是亚马逊s3的新手,并试图将遗留代码方法更改为s3等效方法。代码是这样的:

public static System.Xml.XmlDocument GetXmlDocument(string path)
{
    System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
    using (UNCAccess ua = new UNCAccess(GetDirectoryPath(path)))
    {
        if (FileExists(path)) xmlDoc.Load(path);
    }
    return xmlDoc;
}

我已将上述代码更改为:

public static System.Xml.XmlDocument GetXmlDocument(string path, string key)
{
    System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
    AWSS3File aws = new AWSS3File();
    path = path.Replace("\\", "/");
    path = path.Replace(aws.awsBucketName + "/", "");
    if (!aws.DirectoryExists(path))
    {
        using (aws.client = aws.GetS3Client())
        {
            if (aws.FileExists(key))
                xmlDoc.Load(path);
        }
    }
    return xmlDoc;

    //System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
    //using (UNCAccess ua = new UNCAccess(GetDirectoryPath(path)))
    //{
    //    if (FileExists(path)) xmlDoc.Load(path);
    //}
    //return xmlDoc;
}

但由于此处的返回类型是系统返回类型,因此它不适合s3。我只是想知道xml文档是否有s3等效的返回类型?

欢迎任何建议,并提前感谢您:)

0 个答案:

没有答案