从Silverlight应用程序检索在Sharepoint当前用户登录 [英] Retrieve current user login in Sharepoint from a Silverlight application

查看:81
本文介绍了从Silverlight应用程序检索在Sharepoint当前用户登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从嵌入式Silverlight 4应用程序检索共享点上使用的当前用户登录?

Is it possible to retrieve the current user login used on sharepoint from an embedded Silverlight 4 application?

推荐答案

在SharePoint 2010中

使用客户端对象模型( HTTP: //msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.web.currentuser.aspx ).

Use client object model (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.web.currentuser.aspx).

类似的东西:

public void DoStuff()
{
    ClientContext clientContext = ClientContext.Current;

    clientContext.Load(clientContext.Web, s => s.CurrentUser);
    clientContext.ExecuteQueryAsync((sender, args) => {
        var currentUser = clientContext.Web.CurrentUser;
    }, null);
}

在SharePoint 2007上

不幸的是,客户端对象模型在SP2007上不存在.我所做之前是这样的:

Unfortunatly, the client object model does not exist on SP2007. What I did before is this:

我想有一个WebService你可以直接使用Silverlight的,但我不知道一个在我的头顶.

I guess there is a WebService you can use directly to Silverlight, but I don't know one on the top of my head.

这篇关于从Silverlight应用程序检索在Sharepoint当前用户登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆