【问题标题】:Working with custom role in VB.NET win application在 VB.NET win 应用程序中使用自定义角色
【发布时间】:2011-02-10 15:24:21
【问题描述】:

我正在寻找使用 vb.net 在 Windows 应用程序中实现自定义用户角色的方法。我有一个名为 Roles 的数据库表,其中包含管理员和用户条目。用户看不到某些表单数据。在 ASP.NET MVC 中我们可以这样做。

[Authorize(Roles = "Administrator")]
public function GetAccount() as Array

End Function

如果能以这种方式完成,那就太好了。

提前致谢。

【问题讨论】:

    标签: vb.net custom-attributes user-roles


    【解决方案1】:

    ASP.NET Authorize 属性的源代码在线here。您可以看到他们如何在 MVC 中实现它并根据您的需要进行调整。

    【讨论】:

      猜你喜欢
      • 2011-12-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-20
      • 1970-01-01
      • 2022-12-13
      • 1970-01-01
      相关资源
      最近更新 更多