小编Mar*_*tin的帖子

应用已阻止呼叫O365 Discovery服务

该应用程序已注册并正常工作,可致电O365 Discovery Service以发现API端点.但它最近停止了工作.我知道明年发现服务将被淘汰,但它现在应该仍然有效.

错误是:

{"error":{"code":"101,Microsoft.Online.Services.O365Discovery.O365DiscoveryException","message":"应用程序ID被阻止以访问O365 Discovery服务."}}

service discovery office365

6
推荐指数
1
解决办法
681
查看次数

当我使用其他片段时,viewpager在棒棒糖5.0中无法正常工作

这个问题只发生在棒棒糖中.kitkat和以前的版本正常工作!

问题是我使用了一个页面视图实现了一个滑块,在第一个片段中我有两个按钮的登录片段.

当应用程序启动时没有问题,但是当我使用页面视图更改片段并返回到登录片段时,按钮不起作用.

按钮将注册表单或登录表单加载到同一个片段中.没有错误,只有按钮什么都不做.

这是代码:

public class ScreenSlideActivity extends ActionBarActivity {
    /**
     * The number of pages (wizard steps) to show in this demo.
     */
    private static final int NUM_PAGES = 5;

    /**
     * The pager widget, which handles animation and allows swiping horizontally to access previous
     * and next wizard steps.
     */
    private ViewPager mPager;

    /**
     * The pager adapter, which provides the pages to the view pager widget.
     */
    private PagerAdapter mPagerAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) { …
Run Code Online (Sandbox Code Playgroud)

android android-fragments android-viewpager android-5.0-lollipop

5
推荐指数
1
解决办法
1247
查看次数

Azure 资源管理器 .Net API 无法获取资源组

我正在尝试编写一个独立程序来使用 Azure 资源管理器 .Net 库访问 Azure 资源组详细信息。根据文档,每个资源管理器请求中都需要 Azure AD 身份验证和令牌。所以我在 AD 中创建了一个 Web 应用程序并配置了密钥并使用它来生成令牌。

但即使我在请求中将此令牌作为承载者传递,下面的代码也会失败。

m_resourceClient = new ResourceManagementClient(connection.GetCredentials());
m_resourceClient.HttpClient.DefaultRequestHeaders.Authorization = new     AuthenticationHeaderValue("bearer", connection.GetAccessToken());
***ResourceGroupGetResult resourceGroupList = m_resourceClient.ResourceGroups.Get("PraveenTest")*** ;
Run Code Online (Sandbox Code Playgroud)

错误信息:

AuthorizationFailed: The client '5919f7f9-####-####-####-074456eba98c' with object id '5919f7f9-####-####-####-074456eba98c' does not have authorization to perform action 
'Microsoft.Resources/subscriptions/resourcegroups/read' over scope '/subscriptions/1f94c869-####-####-####-055e8ae15be3/resourcegroups/TestGroup'.
Run Code Online (Sandbox Code Playgroud)

azure-resource-manager

5
推荐指数
1
解决办法
3390
查看次数

使用查询字符串MVC将数组传递给视图

我有多个角色,我需要通过Return RedirectTo Action方法将这些角色传递给另一个视图,

我的守则

string[] roles = new string[] { "Admin", "Supervisor", "Interviewer" };
if (roles.Count() > 1)
{
    return RedirectToAction("LoginAs","Admin",new{@roles = roles});
}
Run Code Online (Sandbox Code Playgroud)

当我在LoginAs视图中这样传递时,向我显示这样的Url,

http://localhost:33883/Admin/LoginAs?roles=System.String[]
Run Code Online (Sandbox Code Playgroud)

但是没有通过的价值观.

c# asp.net asp.net-mvc

3
推荐指数
1
解决办法
920
查看次数