English 中文(简体)
利用网络服务在c#中获取特定文件ID
原标题:Obtaining a specific document ID from sharepoint using web services in c#

I have an external sharepoint site, where I need to update the metadata of a large set of files. The best way to do this seems to be using the Lists web service, and using the Lists.UpdateListItems method. However, this method requires the ID of the document on the server, information I don t have. I do have the filepath/filename of the document.

利用名称/名称获取标识的最佳方式是什么?

最佳回答

If you need to go with the web service, you will probably have to go with SPQueries (CAML) to get the items you want.

The Lists.asmx web service ( place under http://site Collection/_vti_bin/Lists.asmx) has a function打,该功能是作为Qery的一部分。

我并不真正知道你名单上的内在工作,但像这种问话一样,应该:

XmlDocument camlDocument = new XmlDocument();
XmlNode queryNode = camlDocument.CreateElement("Query");
queryNode.InnerXml = "<Where>"
+ "<Eq><FieldRef Name= FileName  /><Value Type= Text >{Your Filename Here}</Value></Eq>"
+ "</Where>";

XmlNode viewFieldsNode = camlDocument.CreateElement("ViewFields");
viewFieldsNode.InnerXml = "<FieldRef Name= ID  />";

XmlNode queryOptionsNode = camlDocument.CreateElement("QueryOptions");

resultNode = _sharepointSite.ListsWS.GetListItems(listName, viewName,
queryNode, viewFieldsNode, rowLimit, queryOptionsNode, webID);

“共同点”和“清单”物体是你的网络浏览器(如果你增加你的网络参考资料,就应当自动生成)。

页: 1

这一观点是你想询问的(如果你想询问所有情况,你就会有这样的观点。 我通常依靠隐蔽的观点来确保用户不会改变这些观点。

罗尔特只是一个 in。

你们在网络服务中工作的网络,找不到任何问题。

你们将回头的XML不是直线的,需要特别关注。 更多信息

请注意,如果你处理带宽的夹,你将补充以下代码:

XmlNode queryOptionsNode = camlDocument.CreateElement("QueryOptions");
queryOptionsNode.InnerXml = "<ViewAttributes Scope="Recursive" />";

关于我解释的内容的更多信息:here

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签