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

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

问题描述

是否可以从嵌入式 Silverlight 4 应用程序中检索在 sharepoint 上使用的当前用户登录信息?

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

推荐答案

On 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:

我想有一个可以直接用于 Silverlight 的 WebService,但我不知道有一个.

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天全站免登陆