0

We developed an store app it works fine when we deployed in domain2 it not working.As it throwing an error we fixed that error in the domain2 and installed in the domain1 it doesn't work but it working fine in domain2.

I tried using

string dnsName = await Windows.System.UserProfile.UserInformation.GetDomainNameAsync();

but it returning empty string

for eg, I'm having two domains like Dev and Test,my need is to get the name as Dev and Test.

any solution or code is provided is much appreciated.

4

2 回答 2

2

使用此功能需要企业身份验证功能,而这又需要 Windows 应用商店中的企业帐户(而不是个人开发人员帐户)。当然,所有这些都是可能的。

如果未检查企业身份验证,我认为结果将是空白的。文档说GetDomainNameAsync不会引发异常,但在这种情况下我肯定会看到 UnauthorizedAccessException 。

因此,假设这不是问题,请注意,如果用户通过 PC 设置关闭该信息的共享,您将在该调用中获得一个空字符串:

在此处输入图像描述

于 2013-05-20T17:18:30.897 回答
1

要为用户获取域名,您必须使用

string dnsName = Windows.System.UserProfile.UserInformation.GetDomainNameAsync();

MSDN点击这里,这里是MSDN上的用户域名示例。

于 2013-05-20T12:47:09.133 回答