如何获得以下有关SharePoint文档信息。
How can I get following information about a SharePoint document.
创建 在上次修改我使用SharePoint内容数据库alldocs表,但无法找到它非常有用。
I am using alldocs table of sharepoint content database but can't find it very helpful.
如果您在触摸alldocs表,你是不是使用对象模型。而且它不支持,通常是一个坏主意。下面是一些示例code。使用对象模型来获取同样的信息:
If you are touching the alldocs table, you aren't using the object model. Further it isn't supported and is generally a bad idea. Here is some sample code to get that same information using the object model:
using (SPSite site = new SPSite("http://your.sharepoint.server/"))
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.Lists["Documents"];
SPListItem item = list.Items[0];
string author = (string)item["Author"];
DateTime modified = (DateTime)item["Modified"];
}
}