1
在谷歌文档我有一个结构:移动文件或文件夹到谷歌文档在不同的文件夹API问题
Folder1
+------Folder1-1
+------+------File1-1-1
+------Folder1-2
+------File1-1
Folder2
我想移动“File1-1”到“文件夹2”使用的.Net API谷歌库(Google Data API SDK)
public static void moveFolder(string szUserName, string szPassword, string szResouceID, string szToFolderResourceID)
{
string szSouceUrl = "https://docs.google.com/feeds/default/private/full"
+ "/" + HttpContext.Current.Server.UrlEncode(szResouceID);
Uri sourceUri = new Uri(szSouceUrl);
//create a atom entry
AtomEntry atom = new AtomEntry();
atom.Id = new AtomId(szSouceUrl);
string szTargetUrl = "http://docs.google.com/feeds/default/private/full/folder%3Aroot/contents/";
if (szToFolderResourceID != "")
{
szTargetUrl = "https://docs.google.com/feeds/default/private/full"
+ "/" + HttpContext.Current.Server.UrlEncode(szToFolderResourceID)
+ "/contents"
;
}
Uri targetUri = new Uri(szTargetUrl);
DocumentsService service = new DocumentsService(SERVICENAME);
((GDataRequestFactory)service.RequestFactory).KeepAlive = false;
service.setUserCredentials(szUserName, szPassword);
service.EntrySend(targetUri, atom, GDataRequestType.Insert);
}
运行之后该功能我有:
Folder1
+------Folder1-1
+------+------File1-1-1
+------Folder1-2
+------File1-1
Folder2
+------File1-1
“File1-1” 显示在“Folder1”和“Folder2”,当我从一个文件夹中删除它将被删除在另一个文件夹中。 (期望:“File1-1”仅在“Folder2”中显示)
会发生什么?我怎么解决这个问题?
感谢您的回答。我解决了我的问题。我将File1-1移动到Folder2并将File1-1移出文件夹Folder1 – 2010-12-22 02:01:07