如何在Dropbox xamarin中保存图像或文件?

时间:2013-12-11 15:49:32

标签: ios xamarin.ios components xamarin dropbox

我试图在Dropbox中保存文档,我已将文档保存在设备上。以及从我的应用程序中保存Dropbox中的UIImage。

    DBError error;

        string ruta = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
        string rutaarchivo = Path.Combine(ruta,"Geodesia.xml");
        DBPath newPath = DBPath.Root.ChildPath(rutaarchivo);
        DBFile archivo = DBFilesystem.SharedFilesystem.CreateFile (newPath,out error);

我使用此代码但只创建文件,有人帮助我吗?

1 个答案:

答案 0 :(得分:0)

根据Dropbox API DocumentationCreateFile仅打开文件。您需要使用WriteContentsOfFile将其他文件的内容复制到其中。

例如:

archivo.WriteContentsOfFile(rutaarchivo, false);